]> source.dussan.org Git - nextcloud-server.git/commitdiff
dont allow using null as view root
authorRobin Appelman <icewind@owncloud.com>
Wed, 22 Apr 2015 12:51:02 +0000 (14:51 +0200)
committerRobin Appelman <icewind@owncloud.com>
Wed, 22 Apr 2015 12:51:02 +0000 (14:51 +0200)
lib/private/files/view.php

index 3300998da35d73f4e9722d8f8340292b90c17bd0..0e0ab0dd21b61738a62239d505efa6ca69880fee 100644 (file)
@@ -76,6 +76,9 @@ class View {
         * @throws \Exception If $root contains an invalid path
         */
        public function __construct($root = '') {
+               if (is_null($root)) {
+                       throw new \InvalidArgumentException('Root cant be null');
+               }
                if(!Filesystem::isValidPath($root)) {
                        throw new \Exception();
                }
@@ -85,6 +88,9 @@ class View {
        }
 
        public function getAbsolutePath($path = '/') {
+               if ($path === null) {
+                       return null;
+               }
                $this->assertPathLength($path);
                if ($path === '') {
                        $path = '/';