diff options
author | Robin Appelman <robin@icewind.nl> | 2022-08-15 21:52:12 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-08-16 14:36:52 +0300 |
commit | 9d6c2ce301f9cb35a6bb7e0a2dbfccb92c0aa996 (patch) | |
tree | ff6077d5fff2efad79d54a49b21d9c102da63e47 /lib/private/Files/Cache | |
parent | cb97e8f15c75cc46e345ebfc79dcad1b9c48bd01 (diff) |
optimize search post-processing for jail wrapperjail-search-post
don't both asking the wrapped cache if we know it's not in our jail anyway
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Cache')
-rw-r--r-- | lib/private/Files/Cache/Wrapper/CacheJail.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index 4053042edd9..834c9fd3d72 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -324,11 +324,13 @@ class CacheJail extends CacheWrapper { } 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; + } } } |