Browse Source

'ID' => 'id' and check existence of EMAIL

tags/v7.0.0alpha2
Thomas Tanghus 10 years ago
parent
commit
aa5bba2bcc
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      core/ajax/share.php

+ 5
- 1
core/ajax/share.php View File

@@ -268,6 +268,10 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
if (!is_null($cm) && $cm->isEnabled()) {
$contacts = $cm->search($_GET['search'], array('FN', 'EMAIL'));
foreach ($contacts as $contact) {
if (!isset($emails = $contact['EMAIL']) {
continue;
}

$emails = $contact['EMAIL'];
if (!is_array($emails)) {
$emails = array($emails);
@@ -275,7 +279,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo

foreach($emails as $email) {
$result[] = array(
'id' => $contact['ID'],
'id' => $contact['id'],
'email' => $email,
'displayname' => $contact['FN'],
);

Loading…
Cancel
Save