Skip to content

Commit

Permalink
Filter email addresses from system addressbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 committed Apr 3, 2018
1 parent b253bd0 commit 7e91eca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/ajax/share.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7e91eca

Please sign in to comment.