]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure that path is normalized and then checked, 35074/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 10 Nov 2022 14:03:15 +0000 (15:03 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 10 Nov 2022 14:03:15 +0000 (15:03 +0100)
 and not the other way around

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/Files/Node/Folder.php

index 268c1d8dd06efddd9ce828f21f86fee07c6187e7..bf9ae3c148d5c6092709f6b9c98d46d61784cd92 100644 (file)
@@ -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() {