mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
fix(View): Normalize path in getAbsolutePath
This allow to match files more consistently in HookConnector::getNodeForPath Signed-off-by: Louis Chmn <louis@chmn.me>
This commit is contained in:
parent
b344b5323d
commit
73c6b17fae
2 changed files with 4 additions and 9 deletions
|
|
@ -11,6 +11,7 @@ use Icewind\Streams\CallbackWrapper;
|
|||
use OC\Files\Mount\MoveableMount;
|
||||
use OC\Files\Storage\Storage;
|
||||
use OC\Files\Storage\Wrapper\Quota;
|
||||
use OC\Files\Utils\PathHelper;
|
||||
use OC\Share\Share;
|
||||
use OC\User\LazyUser;
|
||||
use OC\User\Manager as UserManager;
|
||||
|
|
@ -92,13 +93,7 @@ class View {
|
|||
return null;
|
||||
}
|
||||
$this->assertPathLength($path);
|
||||
if ($path === '') {
|
||||
$path = '/';
|
||||
}
|
||||
if ($path[0] !== '/') {
|
||||
$path = '/' . $path;
|
||||
}
|
||||
return $this->fakeRoot . $path;
|
||||
return PathHelper::normalizePath($this->fakeRoot . '/' . $path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -917,11 +917,11 @@ class ViewTest extends \Test\TestCase {
|
|||
|
||||
public static function absolutePathProvider(): array {
|
||||
return [
|
||||
['/files/', ''],
|
||||
['/files', ''],
|
||||
['/files/0', '0'],
|
||||
['/files/false', 'false'],
|
||||
['/files/true', 'true'],
|
||||
['/files/', '/'],
|
||||
['/files', '/'],
|
||||
['/files/test', 'test'],
|
||||
['/files/test', '/test'],
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue