]> source.dussan.org Git - nextcloud-server.git/commitdiff
Test valid path only if file info has to be retrieved 34994/head
authorGlandos <bugs-github@antipoul.fr>
Sun, 6 Nov 2022 18:23:23 +0000 (19:23 +0100)
committerGlandos <bugs-github@antipoul.fr>
Sun, 6 Nov 2022 18:23:53 +0000 (19:23 +0100)
Signed-off-by: Glandos <bugs-github@antipoul.fr>
lib/private/Files/Node/Node.php

index bfa4d6861ea033927074300afdcdceede2a0b75d..8a752ff281def93db3f5855129e8bb90c3c2903a 100644 (file)
@@ -99,10 +99,10 @@ class Node implements \OCP\Files\Node {
         * @throws NotFoundException
         */
        public function getFileInfo() {
-               if (!Filesystem::isValidPath($this->path)) {
-                       throw new InvalidPathException();
-               }
                if (!$this->fileInfo) {
+                       if (!Filesystem::isValidPath($this->path)) {
+                               throw new InvalidPathException();
+                       }
                        $fileInfo = $this->view->getFileInfo($this->path);
                        if ($fileInfo instanceof FileInfo) {
                                $this->fileInfo = $fileInfo;