Merge pull request #59388 from nextcloud/fix/noid/files-search-default-limit

fix(file-search): use default limit to search query if not provided on request body
This commit is contained in:
Ferdinand Thiessen
2026-04-02 20:13:40 +02:00
committed by GitHub
2 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -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,
@@ -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