Skip to content

Commit e4bb0ba

Browse files
committed
fix(View): Normalize path in getAbsolutePath
This allow to match files more consistently in HookConnector::getNodeForPath Signed-off-by: Louis Chmn <[email protected]>
1 parent 11f8306 commit e4bb0ba

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/private/Files/View.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use OC\Files\Mount\MoveableMount;
1212
use OC\Files\Storage\Storage;
1313
use OC\Files\Storage\Wrapper\Quota;
14+
use OC\Files\Utils\PathHelper;
1415
use OC\Share\Share;
1516
use OC\User\LazyUser;
1617
use OC\User\Manager as UserManager;
@@ -92,13 +93,7 @@ public function getAbsolutePath($path = '/'): ?string {
9293
return null;
9394
}
9495
$this->assertPathLength($path);
95-
if ($path === '') {
96-
$path = '/';
97-
}
98-
if ($path[0] !== '/') {
99-
$path = '/' . $path;
100-
}
101-
return $this->fakeRoot . $path;
96+
return PathHelper::normalizePath($this->fakeRoot . $path);
10297
}
10398

10499
/**

0 commit comments

Comments
 (0)