From 7b3170340734a2c9264c4d33828a0a728f4e659a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 6 Feb 2018 18:00:42 +0100 Subject: [PATCH] Limit the number of results when searching for remotes and emails Signed-off-by: Joas Schilling --- apps/files_sharing/lib/Controller/ShareesAPIController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index 5e601f75b959e..4bf3d67dea2ae 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -369,6 +369,9 @@ protected function getRemote($search) { 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 @@ protected function getEmail($search) { 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)) {