Code Duplication    Length = 9-9 lines in 3 locations

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

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/files_sharing/lib/Controller/ShareesAPIController.php 1 location

@@ 395-403 (lines=9) @@
392
	 * @param string $remote
393
	 * @return string
394
	 */
395
	protected function fixRemoteURL($remote) {
396
		$remote = str_replace('\\', '/', $remote);
397
		if ($fileNamePosition = strpos($remote, '/index.php')) {
398
			$remote = substr($remote, 0, $fileNamePosition);
399
		}
400
		$remote = rtrim($remote, '/');
401
402
		return $remote;
403
	}
404
405
	/**
406
	 * @NoAdminRequired