Skip to content

Commit

Permalink
Merge pull request #33763 from nextcloud/backport/33603/stable23
Browse files Browse the repository at this point in the history
[stable23] optimize search post-processing for jail wrapper
  • Loading branch information
blizzz authored Aug 31, 2022
2 parents 1ff9b14 + d7858bf commit 9d9d5cb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/private/Files/Cache/Wrapper/CacheJail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 9d9d5cb

Please sign in to comment.