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

lib/private/Federation/CloudIdManager.php 1 location

@@ 93-101 (lines=9) @@
90
	 * @param string $remote
91
	 * @return string
92
	 */
93
	protected function fixRemoteURL($remote) {
94
		$remote = str_replace('\\', '/', $remote);
95
		if ($fileNamePosition = strpos($remote, '/index.php')) {
96
			$remote = substr($remote, 0, $fileNamePosition);
97
		}
98
		$remote = rtrim($remote, '/');
99
100
		return $remote;
101
	}
102
103
	/**
104
	 * @param string $cloudId

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

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