From b6f8b8da60c1349204d6aecf5c9781bb6193ef68 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 --- apps/files_sharing/lib/Cache.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/files_sharing/lib') diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index 707b64b79d7..7433c15ad85 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -183,16 +183,18 @@ class Cache extends CacheJail { } public function getQueryFilterForStorage(): ISearchOperator { + $storageFilter = \OC\Files\Cache\Cache::getQueryFilterForStorage(); + // Do the normal jail behavior for non files if ($this->storage->getItemType() !== 'file') { - return parent::getQueryFilterForStorage(); + return $this->addJailFilterQuery($storageFilter); } // for single file shares we don't need to do the LIKE return new SearchBinaryOperator( ISearchBinaryOperator::OPERATOR_AND, [ - \OC\Files\Cache\Cache::getQueryFilterForStorage(), + $storageFilter, new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'path', $this->getGetUnjailedRoot()), ] ); -- cgit v1.2.3