Skip to content

Commit 7b31703

Browse files
committed
Limit the number of results when searching for remotes and emails
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 966010f commit 7b31703

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/files_sharing/lib/Controller/ShareesAPIController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ protected function getRemote($search) {
369369

370370
if (!$this->shareeEnumeration) {
371371
$result['results'] = [];
372+
} else {
373+
// Limit the number of search results to the given size
374+
$result['results'] = array_slice($result['results'], $this->offset, $this->limit);
372375
}
373376

374377
if (!$result['exactIdMatch'] && $this->cloudIdManager->isValidCloudId($search) && $this->offset === 0) {
@@ -695,6 +698,9 @@ protected function getEmail($search) {
695698

696699
if (!$this->shareeEnumeration) {
697700
$result['results'] = [];
701+
} else {
702+
// Limit the number of search results to the given size
703+
$result['results'] = array_slice($result['results'], $this->offset, $this->limit);
698704
}
699705

700706
if (!$result['exactIdMatch'] && filter_var($search, FILTER_VALIDATE_EMAIL)) {

0 commit comments

Comments
 (0)