From: Johannes Merkel Date: Mon, 19 Jun 2023 16:00:33 +0000 (+0200) Subject: fix(mail): ContactManager search with fullmatch X-Git-Tag: v26.0.5rc1~1^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=38ba6967293c1bfcf5bb1a4b58a10575ffc5621c;p=nextcloud-server.git fix(mail): ContactManager search with fullmatch Signed-off-by: Johannes Merkel --- diff --git a/lib/private/ContactsManager.php b/lib/private/ContactsManager.php index 5a02968ad9b..c39f7c715cc 100644 --- a/lib/private/ContactsManager.php +++ b/lib/private/ContactsManager.php @@ -58,15 +58,18 @@ class ContactsManager implements IManager { $strictSearch = array_key_exists('strict_search', $options) && $options['strict_search'] === true; if ($addressBook->isSystemAddressBook()) { + $enumeration = !\array_key_exists('enumeration', $options) || $options['enumeration'] !== false; $fullMatch = !\array_key_exists('fullmatch', $options) || $options['fullmatch'] !== false; - if (!$fullMatch) { - // Neither full match is allowed, so skip the system address book + + if (!$enumeration && !$fullMatch) { + // No access to system address book AND no full match allowed continue; } + if ($strictSearch) { $searchOptions['wildcard'] = false; } else { - $searchOptions['wildcard'] = !\array_key_exists('enumeration', $options) || $options['enumeration'] !== false; + $searchOptions['wildcard'] = $enumeration; } } else { $searchOptions['wildcard'] = !$strictSearch;