Code Duplication    Length = 9-9 lines in 3 locations

lib/private/Share/Helper.php 1 location

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

apps/federatedfilesharing/lib/AddressHandler.php 1 location

@@ 175-183 (lines=9) @@
172
	 * @param string $remote
173
	 * @return string
174
	 */
175
	protected function fixRemoteURL($remote) {
176
		$remote = str_replace('\\', '/', $remote);
177
		if ($fileNamePosition = strpos($remote, '/index.php')) {
178
			$remote = substr($remote, 0, $fileNamePosition);
179
		}
180
		$remote = rtrim($remote, '/');
181
182
		return $remote;
183
	}
184
185
}
186

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

@@ 463-471 (lines=9) @@
460
	 * @param string $remote
461
	 * @return string
462
	 */
463
	protected function fixRemoteURL($remote) {
464
		$remote = str_replace('\\', '/', $remote);
465
		if ($fileNamePosition = strpos($remote, '/index.php')) {
466
			$remote = substr($remote, 0, $fileNamePosition);
467
		}
468
		$remote = rtrim($remote, '/');
469
470
		return $remote;
471
	}
472
473
	/**
474
	 * @NoAdminRequired