aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-08-17 10:55:41 +0200
committerGitHub <noreply@github.com>2022-08-17 10:55:41 +0200
commit11d5a1d3dfea09dc53894d51e336c512e75f733d (patch)
treef1758487aaa2a174604e8d8ec8dba69db12c7948 /lib
parent2360d880fa7c08a7280dc8889308ef5151d2bc1c (diff)
parent9d6c2ce301f9cb35a6bb7e0a2dbfccb92c0aa996 (diff)
downloadnextcloud-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.php12
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;
+ }
}
}