diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index 7183a6c0d2a6d..2c8a5b4dbf082 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -324,11 +324,13 @@ public function getQueryFilterForStorage(): ISearchOperator { } public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEntry { - $rawEntry = $this->getCache()->getCacheEntryFromSearchResult($rawEntry); - if ($rawEntry) { - $jailedPath = $this->getJailedPath($rawEntry->getPath()); - if ($jailedPath !== null) { - return $this->formatCacheEntry(clone $rawEntry) ?: null; + if ($this->getGetUnjailedRoot() === '' || strpos($rawEntry->getPath(), $this->getGetUnjailedRoot()) === 0) { + $rawEntry = $this->getCache()->getCacheEntryFromSearchResult($rawEntry); + if ($rawEntry) { + $jailedPath = $this->getJailedPath($rawEntry->getPath()); + if ($jailedPath !== null) { + return $this->formatCacheEntry(clone $rawEntry) ?: null; + } } }