From: Robin Appelman Date: Wed, 22 Apr 2015 12:51:02 +0000 (+0200) Subject: dont allow using null as view root X-Git-Tag: v8.1.0alpha2~2^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f391f88d7f207dc15963eaf1bdee584bd36a573e;p=nextcloud-server.git dont allow using null as view root --- diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 3300998da35..0e0ab0dd21b 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -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 = '/';