From 7ee528fc5a58f2bffe58d3f0912234a056e425c8 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 21 May 2021 15:37:38 +0200 Subject: properly use limit and offset for search in Jail wrapper Signed-off-by: Robin Appelman --- lib/private/Files/Cache/Wrapper/CacheJail.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/private/Files/Cache/Wrapper/CacheJail.php') diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index fe3124301ba..0d8b776fa30 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -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); } /** -- cgit v1.2.3