Browse Source
remove unused method
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
pull/6328/head
Arthur Schiwon
8 years ago
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
2 changed files with
0 additions and
43 deletions
-
apps/files_sharing/lib/Controller/ShareesAPIController.php
-
apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
|
|
|
@ -102,28 +102,6 @@ class ShareesAPIController extends OCSController { |
|
|
|
$this->collaboratorSearch = $collaboratorSearch; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Strips away a potential file names and trailing slashes: |
|
|
|
* - http://localhost |
|
|
|
* - http://localhost/ |
|
|
|
* - http://localhost/index.php |
|
|
|
* - http://localhost/index.php/s/{shareToken} |
|
|
|
* |
|
|
|
* all return: http://localhost |
|
|
|
* |
|
|
|
* @param string $remote |
|
|
|
* @return string |
|
|
|
*/ |
|
|
|
protected function fixRemoteURL($remote) { |
|
|
|
$remote = str_replace('\\', '/', $remote); |
|
|
|
if ($fileNamePosition = strpos($remote, '/index.php')) { |
|
|
|
$remote = substr($remote, 0, $fileNamePosition); |
|
|
|
} |
|
|
|
$remote = rtrim($remote, '/'); |
|
|
|
|
|
|
|
return $remote; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @NoAdminRequired |
|
|
|
* |
|
|
|
|
|
|
|
@ -450,25 +450,4 @@ class ShareesAPIControllerTest extends TestCase { |
|
|
|
|
|
|
|
$this->assertEquals($expected, $this->invokePrivate($this->sharees, 'isV2')); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @dataProvider dataTestFixRemoteUrl |
|
|
|
* |
|
|
|
* @param string $url |
|
|
|
* @param string $expected |
|
|
|
*/ |
|
|
|
public function testFixRemoteUrl($url, $expected) { |
|
|
|
$this->assertSame($expected, |
|
|
|
$this->invokePrivate($this->sharees, 'fixRemoteURL', [$url]) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public function dataTestFixRemoteUrl() { |
|
|
|
return [ |
|
|
|
['http://localhost', 'http://localhost'], |
|
|
|
['http://localhost/', 'http://localhost'], |
|
|
|
['http://localhost/index.php', 'http://localhost'], |
|
|
|
['http://localhost/index.php/s/AShareToken', 'http://localhost'], |
|
|
|
]; |
|
|
|
} |
|
|
|
} |