diff options
author | Joas Schilling <coding@schilljs.com> | 2021-12-08 16:40:39 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-12-08 18:54:42 +0100 |
commit | 84d37143b0acc1f8b9f06e7609d31f3452ffa555 (patch) | |
tree | 2c45bf889f47afa4a5ba03f34eff8a51f55d1239 /lib/private | |
parent | a1d68c0fd681517ee276084e192f2342a6e6f5b9 (diff) | |
download | nextcloud-server-84d37143b0acc1f8b9f06e7609d31f3452ffa555.tar.gz nextcloud-server-84d37143b0acc1f8b9f06e7609d31f3452ffa555.zip |
Only wildcard search if enumeration is allowed
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Collaboration/Collaborators/MailPlugin.php | 10 | ||||
-rw-r--r-- | lib/private/ContactsManager.php | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index 7245501a8bf..59861247ced 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -101,7 +101,15 @@ class MailPlugin implements ISearchPlugin { $emailType = new SearchResultType('emails'); // Search in contacts - $addressBookContacts = $this->contactsManager->search($search, ['EMAIL', 'FN'], ['limit' => $limit, 'offset' => $offset]); + $addressBookContacts = $this->contactsManager->search( + $search, + ['EMAIL', 'FN'], + [ + 'limit' => $limit, + 'offset' => $offset, + 'wildcard' => $this->shareeEnumeration, + ] + ); $lowerSearch = strtolower($search); foreach ($addressBookContacts as $contact) { if (isset($contact['EMAIL'])) { diff --git a/lib/private/ContactsManager.php b/lib/private/ContactsManager.php index e702a439153..7bdb8293857 100644 --- a/lib/private/ContactsManager.php +++ b/lib/private/ContactsManager.php @@ -42,6 +42,7 @@ class ContactsManager implements IManager { * - 'escape_like_param' - If set to false wildcards _ and % are not escaped * - 'limit' - Set a numeric limit for the search results * - 'offset' - Set the offset for the limited search results + * - 'wildcard' - Whether the search should use wildcards * @return array an array of contacts which are arrays of key-value-pairs */ public function search($pattern, $searchProperties = [], $options = []) { |