Merge pull request #8205 from nextcloud/bugfix/noid/fix-result-size-when-searching-for-sharees

[stable12] Better result handling of email search
This commit is contained in:
Morris Jobke 2018-02-21 15:44:41 +01:00 committed by GitHub
commit 0b21cabf10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)) {