]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure that path is normalized and then checked, 35088/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 10 Nov 2022 14:03:15 +0000 (15:03 +0100)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Thu, 10 Nov 2022 18:06:07 +0000 (18:06 +0000)
 and not the other way around

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

index 9eeabd58653b4a693554794b7798ffcfded5822d..3fdb79341a577576093b3c45ba599bb551a170aa 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;
        }
 
        /**
@@ -369,12 +370,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() {