}
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()),
]
);
}
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()),
]
);
} else {
- return $this->getCache()->getQueryFilterForStorage();
+ return $filter;
}
}