summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-06-21 20:04:35 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-07 17:55:55 +0200
commit9f549013b00fdf937619d2bf9b47d6c20d7522f1 (patch)
treecb2d62b37d7d21aa37f26a7a1517c8e2f3b959c0
parent1ffae9d110343d9dbf48e0fb96ce83e6b51cd763 (diff)
downloadnextcloud-server-9f549013b00fdf937619d2bf9b47d6c20d7522f1.tar.gz
nextcloud-server-9f549013b00fdf937619d2bf9b47d6c20d7522f1.zip
fix: obey offset and limit for results from favs and circles
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesReportPlugin.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
index 450fe134772..a828f873086 100644
--- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
@@ -219,6 +219,10 @@ class FilesReportPlugin extends ServerPlugin {
// gather all file ids matching filter
try {
$resultFileIds = $this->processFilterRulesForFileIDs($filterRules);
+ // no logic in circles and favorites for paging, we always have all results, and slice later on
+ $resultFileIds = array_slice($resultFileIds, $offset ?? 0, $limit ?? null);
+ // fetching nodes has paging on DB level – therefore we cannot mix and slice the results, similar
+ // to user backends. I.e. the final result may return more results than requested.
$resultNodes = $this->processFilterRulesForFileNodes($filterRules, $limit ?? null, $offset ?? null);
} catch (TagNotFoundException $e) {
throw new PreconditionFailed('Cannot filter by non-existing tag', 0, $e);