diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index 16e6e6eb0d2..7c44e132c08 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -343,6 +343,7 @@ class FileSearchBackend implements ISearchBackend { }, $query->orderBy); $limit = $query->limit; + $maxResults = $limit->maxResults !== 0 ? (int)$limit->maxResults : 100; $offset = $limit->firstResult; $limitHome = false; @@ -370,7 +371,7 @@ class FileSearchBackend implements ISearchBackend { 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 c6d6f85347b..df98df60e98 100644 --- a/apps/dav/tests/unit/Files/FileSearchBackendTest.php +++ b/apps/dav/tests/unit/Files/FileSearchBackendTest.php @@ -97,7 +97,7 @@ class FileSearchBackendTest extends TestCase { 'name', 'foo' ), - 0, + 100, 0, [], $this->user @@ -126,7 +126,7 @@ class FileSearchBackendTest extends TestCase { 'mimetype', 'foo' ), - 0, + 100, 0, [], $this->user @@ -155,7 +155,7 @@ class FileSearchBackendTest extends TestCase { 'size', 10 ), - 0, + 100, 0, [], $this->user @@ -184,7 +184,7 @@ class FileSearchBackendTest extends TestCase { 'mtime', 10 ), - 0, + 100, 0, [], $this->user @@ -213,7 +213,7 @@ class FileSearchBackendTest extends TestCase { 'mimetype', FileInfo::MIMETYPE_FOLDER ), - 0, + 100, 0, [], $this->user