mirror of
https://github.com/nextcloud/server.git
synced 2024-08-05 20:16:00 +02:00
'ID' => 'id' and check existence of EMAIL
This commit is contained in:
parent
d4c0ac7790
commit
aa5bba2bcc
@ -268,6 +268,10 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
|
|||||||
if (!is_null($cm) && $cm->isEnabled()) {
|
if (!is_null($cm) && $cm->isEnabled()) {
|
||||||
$contacts = $cm->search($_GET['search'], array('FN', 'EMAIL'));
|
$contacts = $cm->search($_GET['search'], array('FN', 'EMAIL'));
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
|
if (!isset($emails = $contact['EMAIL']) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$emails = $contact['EMAIL'];
|
$emails = $contact['EMAIL'];
|
||||||
if (!is_array($emails)) {
|
if (!is_array($emails)) {
|
||||||
$emails = array($emails);
|
$emails = array($emails);
|
||||||
@ -275,7 +279,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
|
|||||||
|
|
||||||
foreach($emails as $email) {
|
foreach($emails as $email) {
|
||||||
$result[] = array(
|
$result[] = array(
|
||||||
'id' => $contact['ID'],
|
'id' => $contact['id'],
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
'displayname' => $contact['FN'],
|
'displayname' => $contact['FN'],
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user