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>
pull/28385/head
Robin Appelman 3 years ago committed by John Molakvoæ
parent 63d3931e80
commit 118c647f61
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF

@ -3509,9 +3509,6 @@
<code>string</code>
<code>string</code>
</InvalidReturnType>
<NullableReturnStatement occurrences="1">
<code>$this-&gt;view-&gt;hash($type, $this-&gt;path, $raw)</code>
</NullableReturnStatement>
<UndefinedThisPropertyAssignment occurrences="1">
<code>$this-&gt;exists</code>
</UndefinedThisPropertyAssignment>

@ -328,7 +328,7 @@ class CacheJail extends CacheWrapper {
if ($rawEntry) {
$jailedPath = $this->getJailedPath($rawEntry->getPath());
if ($jailedPath !== null) {
return $this->formatCacheEntry(clone $rawEntry);
return $this->formatCacheEntry(clone $rawEntry) ?: null;
}
}

@ -60,7 +60,7 @@ class CacheWrapper extends Cache {
* Make it easy for wrappers to modify every returned cache entry
*
* @param ICacheEntry $entry
* @return ICacheEntry
* @return ICacheEntry|false
*/
protected function formatCacheEntry($entry) {
return $entry;
@ -311,7 +311,8 @@ class CacheWrapper extends Cache {
public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEntry {
$rawEntry = $this->getCache()->getCacheEntryFromSearchResult($rawEntry);
if ($rawEntry) {
return $this->formatCacheEntry(clone $rawEntry);
$entry = $this->formatCacheEntry(clone $rawEntry);
return $entry ?: null;
}
return null;

Loading…
Cancel
Save