Skip to content

Commit

Permalink
fix(contactsintegration): Limit number of matches
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Nov 22, 2024
1 parent a6c4f2f commit 6d2700e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/Service/ContactsIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ public function getMatchingRecipient(string $userId, string $term): array {
$shareeEnumerationFullMatchUserId = $shareeEnumerationFullMatch && $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_userid', 'yes') === 'yes';
$shareeEnumerationFullMatchEmail = $shareeEnumerationFullMatch && $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_email', 'yes') === 'yes';

$result = $this->contactsManager->search($term, ['UID', 'FN', 'EMAIL'], ['enumeration' => $shareeEnumeration, 'fullmatch' => $shareeEnumerationFullMatch]);
$result = $this->contactsManager->search(
$term,
['UID', 'FN', 'EMAIL'],
[
'enumeration' => $shareeEnumeration,
'fullmatch' => $shareeEnumerationFullMatch,
'limit' => 20,
],
);

Check warning on line 69 in lib/Service/ContactsIntegration.php

View check run for this annotation

Codecov / codecov/patch

lib/Service/ContactsIntegration.php#L61-L69

Added lines #L61 - L69 were not covered by tests
if (empty($result)) {
return [];
}
Expand Down

0 comments on commit 6d2700e

Please sign in to comment.