summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-07-26 17:44:52 +0200
committerRobin Appelman <robin@icewind.nl>2021-07-26 17:44:52 +0200
commit97aadbe46c918ba4fe98290e8552e9de9b5f182d (patch)
tree001efe0c7fd43fc9563babdb93d21cf1a88419aa /lib
parentf72fe8b5583b0c00e2476c7516239bd74290b739 (diff)
downloadnextcloud-server-97aadbe46c918ba4fe98290e8552e9de9b5f182d.tar.gz
nextcloud-server-97aadbe46c918ba4fe98290e8552e9de9b5f182d.zip
dont apply jail search filter is on the root
the extra '/' breaks things and the filter wouldn't do anything anyway except making the databases job harder Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheJail.php26
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php
index 38f47668d5d..2dff76333ad 100644
--- a/lib/private/Files/Cache/Wrapper/CacheJail.php
+++ b/lib/private/Files/Cache/Wrapper/CacheJail.php
@@ -306,17 +306,21 @@ class CacheJail extends CacheWrapper {
}
public function getQueryFilterForStorage(): ISearchOperator {
- return new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND,
- [
- $this->getCache()->getQueryFilterForStorage(),
- new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR,
- [
- new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'path', $this->getGetUnjailedRoot()),
- new SearchComparison(ISearchComparison::COMPARE_LIKE, 'path', $this->getGetUnjailedRoot() . '/%'),
- ],
- )
- ]
- );
+ if ($this->root !== '' && $this->root !== '/') {
+ return new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND,
+ [
+ $this->getCache()->getQueryFilterForStorage(),
+ new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR,
+ [
+ new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'path', $this->getGetUnjailedRoot()),
+ new SearchComparison(ISearchComparison::COMPARE_LIKE, 'path', $this->getGetUnjailedRoot() . '/%'),
+ ],
+ )
+ ]
+ );
+ } else {
+ return $this->getCache()->getQueryFilterForStorage();
+ }
}
public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEntry {