Code Duplication    Length = 17-17 lines in 2 locations

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
	}

apps/federatedfilesharing/lib/AddressHandler.php 1 location

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