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

@@ 252-268 (lines=17) @@
249
		$normalizedServer1 = \strtolower(\OC\Share\Share::removeProtocolFromUrl($server1));
250
		$normalizedServer2 = \strtolower(\OC\Share\Share::removeProtocolFromUrl($server2));
251
252
		if (\rtrim($normalizedServer1, '/') === \rtrim($normalizedServer2, '/')) {
253
			// FIXME this should be a method in the user management instead
254
			\OCP\Util::emitHook(
255
					'\OCA\Files_Sharing\API\Server2Server',
256
					'preLoginNameUsedAsUserName',
257
					['uid' => &$user1]
258
			);
259
			\OCP\Util::emitHook(
260
					'\OCA\Files_Sharing\API\Server2Server',
261
					'preLoginNameUsedAsUserName',
262
					['uid' => &$user2]
263
			);
264
265
			if ($user1 === $user2) {
266
				return true;
267
			}
268
		}
269
270
		return false;
271
	}