diff options
author | Robin Appelman <robin@icewind.nl> | 2021-05-21 15:37:38 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-05-21 15:37:38 +0200 |
commit | 7ee528fc5a58f2bffe58d3f0912234a056e425c8 (patch) | |
tree | 6318f58975882417f62b128d80145744f41cb14a /lib/private/Files/Cache/Wrapper/CacheJail.php | |
parent | 4aae71cd77e5117f06cabcc8a3933328f2df6533 (diff) | |
download | nextcloud-server-7ee528fc5a58f2bffe58d3f0912234a056e425c8.tar.gz nextcloud-server-7ee528fc5a58f2bffe58d3f0912234a056e425c8.zip |
properly use limit and offset for search in Jail wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Cache/Wrapper/CacheJail.php')
-rw-r--r-- | lib/private/Files/Cache/Wrapper/CacheJail.php | 9 |
1 files changed, 2 insertions, 7 deletions
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); } /** |