From 7e91eca6348e4d776b4a033a23701747a40b891b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 3 Apr 2018 12:02:27 +0200 Subject: [PATCH] Filter email addresses from system addressbooks --- core/ajax/share.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/ajax/share.php b/core/ajax/share.php index 9ed6dcba30b3..544f4efed57f 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -310,9 +310,13 @@ function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { $userEnumerationAllowed = OC::$server->getConfig() ->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') == 'yes'; - if (!is_null($cm) && $cm->isEnabled() && $userEnumerationAllowed) { + if ($cm !== null && $cm->isEnabled() && $userEnumerationAllowed) { $contacts = $cm->search((string)$_GET['search'], ['FN', 'EMAIL']); foreach ($contacts as $contact) { + // We don't want contacts from system address books + if (isset($contact['isSystemBook'])) { + continue; + } if (!isset($contact['EMAIL'])) { continue; }