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

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

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

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