Code Duplication    Length = 17-17 lines in 2 locations

apps/federatedfilesharing/lib/AddressHandler.php 1 location

@@ 126-142 (lines=17) @@
123
		$normalizedServer1 = \strtolower($this->removeProtocolFromUrl($server1));
124
		$normalizedServer2 = \strtolower($this->removeProtocolFromUrl($server2));
125
126
		if (\rtrim($normalizedServer1, '/') === \rtrim($normalizedServer2, '/')) {
127
			// FIXME this should be a method in the user management instead
128
			\OCP\Util::emitHook(
129
				'\OCA\Files_Sharing\API\Server2Server',
130
				'preLoginNameUsedAsUserName',
131
				['uid' => &$user1]
132
			);
133
			\OCP\Util::emitHook(
134
				'\OCA\Files_Sharing\API\Server2Server',
135
				'preLoginNameUsedAsUserName',
136
				['uid' => &$user2]
137
			);
138
139
			if ($user1 === $user2) {
140
				return true;
141
			}
142
		}
143
144
		return false;
145
	}

lib/private/Share/Helper.php 1 location

@@ 303-319 (lines=17) @@
300
		$normalizedServer1 = \strtolower(\OC\Share\Share::removeProtocolFromUrl($server1));
301
		$normalizedServer2 = \strtolower(\OC\Share\Share::removeProtocolFromUrl($server2));
302
303
		if (\rtrim($normalizedServer1, '/') === \rtrim($normalizedServer2, '/')) {
304
			// FIXME this should be a method in the user management instead
305
			\OCP\Util::emitHook(
306
					'\OCA\Files_Sharing\API\Server2Server',
307
					'preLoginNameUsedAsUserName',
308
					['uid' => &$user1]
309
			);
310
			\OCP\Util::emitHook(
311
					'\OCA\Files_Sharing\API\Server2Server',
312
					'preLoginNameUsedAsUserName',
313
					['uid' => &$user2]
314
			);
315
316
			if ($user1 === $user2) {
317
				return true;
318
			}
319
		}
320
321
		return false;
322
	}