diff options
-rw-r--r-- | apps/dav/lib/Connector/Sabre/SharesPlugin.php | 13 | ||||
-rw-r--r-- | lib/private/Files/View.php | 24 |
2 files changed, 13 insertions, 24 deletions
diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index bbfbfc04a72..57c91e05a8c 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -201,18 +201,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin { !is_null($propFind->getStatus(self::SHAREES_PROPERTYNAME)) ) ) { - try { - $folderNode = $sabreNode->getNode(); - } catch (NotFoundException $e) { - // If the folder can't be properly found just return - return; - } - - if (!($folderNode instanceof Folder)) { - // Safety check - return; - } - + $folderNode = $sabreNode->getNode(); $this->cachedFolders[] = $sabreNode->getPath(); $childShares = $this->getSharesFolder($folderNode); foreach ($childShares as $id => $shares) { diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index eef87cc65f4..30dc5518be8 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1449,21 +1449,21 @@ class View { $cache = $storage->getCache($internalPath); $user = \OC_User::getUser(); - if (!$directoryInfo) { - $data = $this->getCacheEntry($storage, $internalPath, $directory); - if (!$data instanceof ICacheEntry || !isset($data['fileid'])) { - return []; - } - } else { - $data = $directoryInfo; - } - - if (!($data->getPermissions() & Constants::PERMISSION_READ)) { + if (!$directoryInfo) { + $data = $this->getCacheEntry($storage, $internalPath, $directory); + if (!$data instanceof ICacheEntry || !isset($data['fileid'])) { return []; } + } else { + $data = $directoryInfo; + } + + if (!($data->getPermissions() & Constants::PERMISSION_READ)) { + return []; + } - $folderId = $data->getId(); - $contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter + $folderId = $data->getId(); + $contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter $sharingDisabled = \OCP\Util::isSharingDisabledForUser(); |