Code Duplication    Length = 17-17 lines in 2 locations

apps/federatedfilesharing/lib/AddressHandler.php 1 location

@@ 102-118 (lines=17) @@
99
		$normalizedServer1 = strtolower($this->removeProtocolFromUrl($server1));
100
		$normalizedServer2 = strtolower($this->removeProtocolFromUrl($server2));
101
102
		if (rtrim($normalizedServer1, '/') === rtrim($normalizedServer2, '/')) {
103
			// FIXME this should be a method in the user management instead
104
			\OCP\Util::emitHook(
105
				'\OCA\Files_Sharing\API\Server2Server',
106
				'preLoginNameUsedAsUserName',
107
				array('uid' => &$user1)
108
			);
109
			\OCP\Util::emitHook(
110
				'\OCA\Files_Sharing\API\Server2Server',
111
				'preLoginNameUsedAsUserName',
112
				array('uid' => &$user2)
113
			);
114
115
			if ($user1 === $user2) {
116
				return true;
117
			}
118
		}
119
120
		return false;
121
	}

lib/private/Share/Helper.php 1 location

@@ 275-291 (lines=17) @@
272
		$normalizedServer1 = strtolower(\OC\Share\Share::removeProtocolFromUrl($server1));
273
		$normalizedServer2 = strtolower(\OC\Share\Share::removeProtocolFromUrl($server2));
274
275
		if (rtrim($normalizedServer1, '/') === rtrim($normalizedServer2, '/')) {
276
			// FIXME this should be a method in the user management instead
277
			\OCP\Util::emitHook(
278
					'\OCA\Files_Sharing\API\Server2Server',
279
					'preLoginNameUsedAsUserName',
280
					array('uid' => &$user1)
281
			);
282
			\OCP\Util::emitHook(
283
					'\OCA\Files_Sharing\API\Server2Server',
284
					'preLoginNameUsedAsUserName',
285
					array('uid' => &$user2)
286
			);
287
288
			if ($user1 === $user2) {
289
				return true;
290
			}
291
		}
292
293
		return false;
294
	}