summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-04-22 14:51:02 +0200
committerRobin Appelman <icewind@owncloud.com>2015-04-22 14:51:02 +0200
commitf391f88d7f207dc15963eaf1bdee584bd36a573e (patch)
tree3f88470c824678a37386001cda29a77cf20e247a /lib
parent42d9ba0f83f3e4b1d0eaa4aa60cddc89f239dda7 (diff)
downloadnextcloud-server-f391f88d7f207dc15963eaf1bdee584bd36a573e.tar.gz
nextcloud-server-f391f88d7f207dc15963eaf1bdee584bd36a573e.zip
dont allow using null as view root
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/view.php6
1 files changed, 6 insertions, 0 deletions
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 = '/';