Skip to content

Commit 99dbe6a

Browse files
icewind1991skjnldsv
authored andcommitted
properly handle cases where cache wrappers block access
`CacheWrapper::formatCacheEntry` can return false for files that should be filtered out Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 8b742ab commit 99dbe6a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/private/Files/Cache/Wrapper/CacheWrapper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function getCache() {
6060
* Make it easy for wrappers to modify every returned cache entry
6161
*
6262
* @param ICacheEntry $entry
63-
* @return ICacheEntry
63+
* @return ICacheEntry|false
6464
*/
6565
protected function formatCacheEntry($entry) {
6666
return $entry;
@@ -311,7 +311,8 @@ public function getQueryFilterForStorage(): ISearchOperator {
311311
public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEntry {
312312
$rawEntry = $this->getCache()->getCacheEntryFromSearchResult($rawEntry);
313313
if ($rawEntry) {
314-
return $this->formatCacheEntry(clone $rawEntry);
314+
$entry = $this->formatCacheEntry(clone $rawEntry);
315+
return $entry ?: null;
315316
}
316317

317318
return null;

0 commit comments

Comments
 (0)