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; }