From: Côme Chilliet Date: Thu, 10 Nov 2022 14:03:15 +0000 (+0100) Subject: Make sure that path is normalized and then checked, X-Git-Tag: v26.0.0beta1~439^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a78595a45f5df29531205c5985ac6300c3094c6f;p=nextcloud-server.git Make sure that path is normalized and then checked, and not the other way around Signed-off-by: Côme Chilliet --- 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() {