Limit the number of results when searching for remotes and emails

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2018-02-06 18:00:42 +01:00
parent 966010f87f
commit 7b31703407
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 6 additions and 0 deletions

View File

@ -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)) {