mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
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>
This commit is contained in:
parent
f72fe8b558
commit
97aadbe46c
1 changed files with 15 additions and 11 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue