diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-07-29 16:59:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-29 16:59:26 +0200 |
commit | e21f4409909ae13f1a6f4f0328eb2ab4fa85b16b (patch) | |
tree | cc35a50ead4b0ddaa0ba343f0719825752e1a7d8 /lib | |
parent | 8d8766d5a7b51a01d1c90bb237e1cbdd44f46bfc (diff) | |
parent | e43b341b04c5e13424f2d833803c0e444f8ab3b2 (diff) | |
download | nextcloud-server-e21f4409909ae13f1a6f4f0328eb2ab4fa85b16b.tar.gz nextcloud-server-e21f4409909ae13f1a6f4f0328eb2ab4fa85b16b.zip |
Merge pull request #16502 from nextcloud/bugfix/16474
Check the if we can actually access the storage cache for recent files
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Node/Folder.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index b0569a24aa1..19f04048779 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -442,8 +442,13 @@ class Folder extends Node implements \OCP\Files\Folder { }, $result)); return array_values(array_filter($files, function (Node $node) { + $cacheEntry = $node->getMountPoint()->getStorage()->getCache()->get($node->getId()); + if (!$cacheEntry) { + return false; + } $relative = $this->getRelativePath($node->getPath()); - return $relative !== null && $relative !== '/'; + return $relative !== null && $relative !== '/' + && ($cacheEntry->getPermissions() & \OCP\Constants::PERMISSION_READ) === \OCP\Constants::PERMISSION_READ; })); } |