Code Duplication    Length = 9-9 lines in 3 locations

lib/private/Share/Helper.php 1 location

@@ 234-242 (lines=9) @@
231
	 * @param string $remote
232
	 * @return string
233
	 */
234
	protected static function fixRemoteURL($remote) {
235
		$remote = str_replace('\\', '/', $remote);
236
		if ($fileNamePosition = strpos($remote, '/index.php')) {
237
			$remote = substr($remote, 0, $fileNamePosition);
238
		}
239
		$remote = rtrim($remote, '/');
240
241
		return $remote;
242
	}
243
244
	/**
245
	 * split user and remote from federated cloud id

apps/federatedfilesharing/lib/AddressHandler.php 1 location

@@ 191-199 (lines=9) @@
188
	 * @param string $remote
189
	 * @return string
190
	 */
191
	protected function fixRemoteURL($remote) {
192
		$remote = str_replace('\\', '/', $remote);
193
		if ($fileNamePosition = strpos($remote, '/index.php')) {
194
			$remote = substr($remote, 0, $fileNamePosition);
195
		}
196
		$remote = rtrim($remote, '/');
197
198
		return $remote;
199
	}
200
201
}
202

apps/files_sharing/lib/Controller/ShareesAPIController.php 1 location

@@ 407-415 (lines=9) @@
404
	 * @param string $remote
405
	 * @return string
406
	 */
407
	protected function fixRemoteURL($remote) {
408
		$remote = str_replace('\\', '/', $remote);
409
		if ($fileNamePosition = strpos($remote, '/index.php')) {
410
			$remote = substr($remote, 0, $fileNamePosition);
411
		}
412
		$remote = rtrim($remote, '/');
413
414
		return $remote;
415
	}
416
417
	/**
418
	 * @NoAdminRequired