From 9cadbe811eb6931ea29dd43745d10cdbe2f99b1f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 17 Aug 2022 11:58:57 +0200 Subject: directly build the search filter for shared storage instead of setting up the source cache Signed-off-by: Robin Appelman --- lib/private/Files/Cache/Wrapper/CacheJail.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index 7183a6c0d2a..ffd446dae30 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -306,10 +306,14 @@ class CacheJail extends CacheWrapper { } public function getQueryFilterForStorage(): ISearchOperator { + return $this->addJailFilterQuery($this->getCache()->getQueryFilterForStorage()); + } + + protected function addJailFilterQuery(ISearchOperator $filter): ISearchOperator { if ($this->getGetUnjailedRoot() !== '' && $this->getGetUnjailedRoot() !== '/') { return new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND, [ - $this->getCache()->getQueryFilterForStorage(), + $filter, new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR, [ new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'path', $this->getGetUnjailedRoot()), @@ -319,7 +323,7 @@ class CacheJail extends CacheWrapper { ] ); } else { - return $this->getCache()->getQueryFilterForStorage(); + return $filter; } } -- cgit v1.2.3