]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache: check for invalid paths in getFileInfo/getDirectoryContent
authorRobin Appelman <icewind@owncloud.com>
Sun, 3 Feb 2013 22:34:27 +0000 (23:34 +0100)
committerRobin Appelman <icewind@owncloud.com>
Sun, 3 Feb 2013 22:34:27 +0000 (23:34 +0100)
lib/files/view.php

index 302232b5134a90056d44f1d09cfbdb2b35082f0f..ff94d3e602b6ae1aecd8b7efc0c1eeb12d323089 100644 (file)
@@ -670,6 +670,9 @@ class View {
         */
        public function getFileInfo($path) {
                $data = array();
+               if (!Filesystem::isValidPath($path)) {
+                       return $data;
+               }
                $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path);
                /**
                 * @var \OC\Files\Storage\Storage $storage
@@ -724,6 +727,9 @@ class View {
         */
        public function getDirectoryContent($directory, $mimetype_filter = '') {
                $result = array();
+               if (!Filesystem::isValidPath($path)) {
+                       return $data;
+               }
                $path = Filesystem::normalizePath($this->fakeRoot . '/' . $directory);
                /**
                 * @var \OC\Files\Storage\Storage $storage