aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Merkel <mail@johannesgge.de>2023-06-19 18:00:33 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-07-18 08:52:40 +0000
commit7065a5e0e45856e9418612902b037e72ad7c90fe (patch)
treedb1935ef823374d5ce98f291749c724256c63987
parent855e766caed8106b6cdf46182bc98d501762a731 (diff)
downloadnextcloud-server-7065a5e0e45856e9418612902b037e72ad7c90fe.tar.gz
nextcloud-server-7065a5e0e45856e9418612902b037e72ad7c90fe.zip
fix(mail): ContactManager search with fullmatch
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
-rw-r--r--lib/private/ContactsManager.php9
1 files changed, 6 insertions, 3 deletions
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;