mirror of
https://github.com/nextcloud/server.git
synced 2026-05-22 10:06:37 -04:00
Merge pull request #29509 from nextcloud/backport/28385/stable22
[stable22] properly handle cases where cache wrappers block access
This commit is contained in:
commit
62416a35ee
2 changed files with 4 additions and 3 deletions
|
|
@ -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