Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
properly use limit and offset for search in Jail wrapper
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed May 31, 2021
commit a21eb8d6d2f9498456fa581b721728eb601cadb7
9 changes: 2 additions & 7 deletions lib/private/Files/Cache/Wrapper/CacheJail.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,9 @@ public function searchQuery(ISearchQuery $query) {
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);
}

/**
Expand Down