diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-08-17 10:55:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 10:55:41 +0200 |
commit | 11d5a1d3dfea09dc53894d51e336c512e75f733d (patch) | |
tree | f1758487aaa2a174604e8d8ec8dba69db12c7948 /lib | |
parent | 2360d880fa7c08a7280dc8889308ef5151d2bc1c (diff) | |
parent | 9d6c2ce301f9cb35a6bb7e0a2dbfccb92c0aa996 (diff) | |
download | nextcloud-server-11d5a1d3dfea09dc53894d51e336c512e75f733d.tar.gz nextcloud-server-11d5a1d3dfea09dc53894d51e336c512e75f733d.zip |
Merge pull request #33550 from nextcloud/jail-search-post
optimize search post-processing for jail wrapper
Diffstat (limited to 'lib')
-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; + } } } |