diff options
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Activity/Providers/Base.php | 7 | ||||
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/Activity/Providers/Base.php b/apps/files_sharing/lib/Activity/Providers/Base.php index 948d629c8fc..e61bdffadcd 100644 --- a/apps/files_sharing/lib/Activity/Providers/Base.php +++ b/apps/files_sharing/lib/Activity/Providers/Base.php @@ -203,7 +203,12 @@ abstract class Base implements IProvider { return $this->displayNames[$search]; } - $addressBookContacts = $this->contactsManager->search($search, ['CLOUD']); + $addressBookContacts = $this->contactsManager->search($search, ['CLOUD'], [ + 'limit' => 1, + 'enumeration' => false, + 'fullmatch' => false, + 'strict_search' => true, + ]); foreach ($addressBookContacts as $contact) { if (isset($contact['isLocalSystemBook'])) { continue; diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 96b105aae49..ff134f61e17 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -334,8 +334,12 @@ class ShareAPIController extends OCSController { * @return string */ private function getDisplayNameFromAddressBook(string $query, string $property): string { - // FIXME: If we inject the contacts manager it gets initialized bofore any address books are registered - $result = \OC::$server->getContactsManager()->search($query, [$property]); + // FIXME: If we inject the contacts manager it gets initialized before any address books are registered + $result = \OC::$server->getContactsManager()->search($query, [$property], [ + 'limit' => 1, + 'enumeration' => false, + 'strict_search' => true, + ]); foreach ($result as $r) { foreach ($r[$property] as $value) { if ($value === $query && $r['FN']) { |