[Pkg-owncloud-commits] [owncloud] 08/15: dont allow using null as view root

David Prévot taffit at moszumanska.debian.org
Thu Jul 2 18:39:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.5RC1
in repository owncloud.

commit 698274491a0d402bec9c4351031960ef9f421b8c
Author: Robin Appelman <icewind at owncloud.com>
Date:   Wed Apr 22 14:51:02 2015 +0200

    dont allow using null as view root
---
 lib/private/files/view.php | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 6f456d8..b07225c 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -35,13 +35,23 @@ class View {
 	 * @var \OC\Files\Cache\Updater
 	 */
 	protected $updater;
-
+	
 	public function __construct($root = '') {
+		if (is_null($root)) {
+			throw new \InvalidArgumentException('Root can\'t be null');
+		}
+		if(!Filesystem::isValidPath($root)) {
+			throw new \Exception();
+		}
+		
 		$this->fakeRoot = $root;
 		$this->updater = new Updater($this);
 	}
 
 	public function getAbsolutePath($path = '/') {
+		if ($path === null) {
+			return null;
+		}
 		$this->assertPathLength($path);
 		if ($path === '') {
 			$path = '/';

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list