diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-11-10 17:03:15 +0300 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2022-11-10 20:55:12 +0300 |
commit | bc908b044a6fac9401fdf110bbd8ac2b6497ded2 (patch) | |
tree | 1d1f94caf9a8d7d50ab1c6bac6e86c0042c1dcbc | |
parent | 1cce67e18dfcd896e2da01952c338196835d587f (diff) |
Make sure that path is normalized and then checked,
and not the other way around
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | lib/private/Files/Node/Folder.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 268c1d8dd06..bf9ae3c148d 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -66,10 +66,11 @@ class Folder extends Node implements \OCP\Files\Folder { * @throws \OCP\Files\NotPermittedException */ public function getFullPath($path) { + $path = $this->normalizePath($path); if (!$this->isValidPath($path)) { throw new NotPermittedException('Invalid path'); } - return $this->path . $this->normalizePath($path); + return $this->path . $path; } /** @@ -371,12 +372,12 @@ class Folder extends Node implements \OCP\Files\Folder { return [$this->root->createNode( $absolutePath, new \OC\Files\FileInfo( - $absolutePath, - $mount->getStorage(), - $cacheEntry->getPath(), - $cacheEntry, - $mount - ))]; + $absolutePath, + $mount->getStorage(), + $cacheEntry->getPath(), + $cacheEntry, + $mount + ))]; } public function getFreeSpace() { |