]> source.dussan.org Git - nextcloud-server.git/commitdiff
handle errors while getting fileinfo
authorRobin Appelman <icewind@owncloud.com>
Tue, 5 Jul 2016 21:19:30 +0000 (23:19 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Fri, 8 Jul 2016 10:36:07 +0000 (12:36 +0200)
apps/files_sharing/ajax/shareinfo.php

index 002d7ab275ea3b6fce1c429e7c44b3e4f2b733db..0b93e3d2ee943e97577f8747636bfd949edb4389 100644 (file)
@@ -71,7 +71,7 @@ $shareManager = \OC::$server->getShareManager();
 $share = $shareManager->getShareByToken($token);
 $sharePermissions= (int)$share->getPermissions();
 
-if(!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) {
+if($rootInfo === false || !($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) {
        OCP\JSON::error(array('data' => 'Share is not readable.'));
        exit();
 }