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:
authorRobin Appelman <robin@icewind.nl>2022-08-17 12:58:57 +0300
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-08-23 15:19:14 +0300
commit9cadbe811eb6931ea29dd43745d10cdbe2f99b1f (patch)
treefc4ee423302bf5b7b9fd69e57cef73a648082c0c
parentf413456e2f22cfb29662161567a24b13b26a1cf4 (diff)
directly build the search filter for shared storage instead of setting up the source cachebackport/33574/stable24
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/files_sharing/lib/Cache.php6
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheJail.php8
2 files changed, 10 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index d245727b138..99f4f006997 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -182,16 +182,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()),
]
);
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;
}
}