mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
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>
This commit is contained in:
parent
63d3931e80
commit
118c647f61
3 changed files with 4 additions and 6 deletions
|
|
@ -3509,9 +3509,6 @@
|
|||
<code>string</code>
|
||||
<code>string</code>
|
||||
</InvalidReturnType>
|
||||
<NullableReturnStatement occurrences="1">
|
||||
<code>$this->view->hash($type, $this->path, $raw)</code>
|
||||
</NullableReturnStatement>
|
||||
<UndefinedThisPropertyAssignment occurrences="1">
|
||||
<code>$this->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…
Reference in a new issue