Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-08-17 11:55:41 +0300
committerGitHub <noreply@github.com>2022-08-17 11:55:41 +0300
commit11d5a1d3dfea09dc53894d51e336c512e75f733d (patch)
treef1758487aaa2a174604e8d8ec8dba69db12c7948
parent2360d880fa7c08a7280dc8889308ef5151d2bc1c (diff)
parent9d6c2ce301f9cb35a6bb7e0a2dbfccb92c0aa996 (diff)
Merge pull request #33550 from nextcloud/jail-search-post
optimize search post-processing for jail wrapper
-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;
+ }
}
}