diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index 16e6e6eb0d2cf..7c44e132c08f5 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -343,6 +343,7 @@ private function transformQuery(Query $query, ?SearchBinaryOperator $scopeOperat }, $query->orderBy); $limit = $query->limit; + $maxResults = $limit->maxResults !== 0 ? (int)$limit->maxResults : 100; $offset = $limit->firstResult; $limitHome = false; @@ -370,7 +371,7 @@ private function transformQuery(Query $query, ?SearchBinaryOperator $scopeOperat return new SearchQuery( $operators, - (int)$limit->maxResults, + $maxResults, $offset, $orders, $this->user, diff --git a/apps/dav/tests/unit/Files/FileSearchBackendTest.php b/apps/dav/tests/unit/Files/FileSearchBackendTest.php index c6d6f85347bb7..df98df60e9828 100644 --- a/apps/dav/tests/unit/Files/FileSearchBackendTest.php +++ b/apps/dav/tests/unit/Files/FileSearchBackendTest.php @@ -97,7 +97,7 @@ public function testSearchFilename(): void { 'name', 'foo' ), - 0, + 100, 0, [], $this->user @@ -126,7 +126,7 @@ public function testSearchMimetype(): void { 'mimetype', 'foo' ), - 0, + 100, 0, [], $this->user @@ -155,7 +155,7 @@ public function testSearchSize(): void { 'size', 10 ), - 0, + 100, 0, [], $this->user @@ -184,7 +184,7 @@ public function testSearchMtime(): void { 'mtime', 10 ), - 0, + 100, 0, [], $this->user @@ -213,7 +213,7 @@ public function testSearchIsCollection(): void { 'mimetype', FileInfo::MIMETYPE_FOLDER ), - 0, + 100, 0, [], $this->user