diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index 5e601f75b9..4bf3d67dea 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -369,6 +369,9 @@ class ShareesAPIController extends OCSController { if (!$this->shareeEnumeration) { $result['results'] = []; + } else { + // Limit the number of search results to the given size + $result['results'] = array_slice($result['results'], $this->offset, $this->limit); } if (!$result['exactIdMatch'] && $this->cloudIdManager->isValidCloudId($search) && $this->offset === 0) { @@ -695,6 +698,9 @@ class ShareesAPIController extends OCSController { if (!$this->shareeEnumeration) { $result['results'] = []; + } else { + // Limit the number of search results to the given size + $result['results'] = array_slice($result['results'], $this->offset, $this->limit); } if (!$result['exactIdMatch'] && filter_var($search, FILTER_VALIDATE_EMAIL)) {