mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #27303 from nextcloud/backport/27062/stable21
[stable21] properly use limit and offset for search in Jail wrapper
This commit is contained in:
commit
6e190b1a55
1 changed files with 2 additions and 7 deletions
|
|
@ -318,14 +318,9 @@ class CacheJail extends CacheWrapper {
|
|||
ISearchBinaryOperator::OPERATOR_AND,
|
||||
[new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR, [$prefixFilter, $rootFilter]) , $query->getSearchOperation()]
|
||||
);
|
||||
$simpleQuery = new SearchQuery($operation, 0, 0, $query->getOrder(), $query->getUser());
|
||||
$simpleQuery = new SearchQuery($operation, $query->getLimit(), $query->getOffset(), $query->getOrder(), $query->getUser());
|
||||
$results = $this->getCache()->searchQuery($simpleQuery);
|
||||
$results = $this->formatSearchResults($results);
|
||||
|
||||
$limit = $query->getLimit() === 0 ? null : $query->getLimit();
|
||||
$results = array_slice($results, $query->getOffset(), $limit);
|
||||
|
||||
return $results;
|
||||
return $this->formatSearchResults($results);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue