Code Duplication    Length = 9-9 lines in 3 locations

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

@@ 507-515 (lines=9) @@
504
	 * @param string $remote
505
	 * @return string
506
	 */
507
	protected function fixRemoteURL($remote) {
508
		$remote = \str_replace('\\', '/', $remote);
509
		if ($fileNamePosition = \strpos($remote, '/index.php')) {
510
			$remote = \substr($remote, 0, $fileNamePosition);
511
		}
512
		$remote = \rtrim($remote, '/');
513
514
		return $remote;
515
	}
516
517
	/**
518
	 * @NoAdminRequired

lib/private/Share/Helper.php 1 location

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

apps/federatedfilesharing/lib/AddressHandler.php 1 location

@@ 146-154 (lines=9) @@
143
	 * @param string $remote
144
	 * @return string
145
	 */
146
	protected function fixRemoteURL($remote) {
147
		$remote = \str_replace('\\', '/', $remote);
148
		if ($fileNamePosition = \strpos($remote, '/index.php')) {
149
			$remote = \substr($remote, 0, $fileNamePosition);
150
		}
151
		$remote = \rtrim($remote, '/');
152
153
		return $remote;
154
	}
155
}
156