]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(mail): ContactManager search with fullmatch 39450/head
authorJohannes Merkel <mail@johannesgge.de>
Mon, 19 Jun 2023 16:00:33 +0000 (18:00 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 2 Aug 2023 19:36:10 +0000 (21:36 +0200)
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
lib/private/ContactsManager.php

index 5a02968ad9bc5a933e3534cb1146b58d3040a494..c39f7c715cc160c26636fac77163f985bc7c37f8 100644 (file)
@@ -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;