From f391f88d7f207dc15963eaf1bdee584bd36a573e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 22 Apr 2015 14:51:02 +0200 Subject: [PATCH] dont allow using null as view root --- lib/private/files/view.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 3300998da3..0e0ab0dd21 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 = '/';