From d49ad7ea47e35a463e4953c9922a5af77ff7acf2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 8 Dec 2021 17:26:30 +0100 Subject: Limit more contact searches Signed-off-by: Joas Schilling --- lib/private/Share/Share.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/private/Share/Share.php') diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index a857a850f9b..548c8a2c451 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -593,7 +593,12 @@ class Share extends Constants { $row['share_with_displayname'] = $shareWithUser === null ? $row['share_with'] : $shareWithUser->getDisplayName(); } elseif (isset($row['share_with']) && $row['share_with'] != '' && $row['share_type'] === IShare::TYPE_REMOTE) { - $addressBookEntries = \OC::$server->getContactsManager()->search($row['share_with'], ['CLOUD']); + $addressBookEntries = \OC::$server->getContactsManager()->search($row['share_with'], ['CLOUD'], [ + 'limit' => 1, + 'enumeration' => false, + 'fullmatch' => false, + 'strict_search' => true, + ]); foreach ($addressBookEntries as $entry) { foreach ($entry['CLOUD'] as $cloudID) { if ($cloudID === $row['share_with']) { -- cgit v1.2.3