forked from extern/egroupware
fix PHP Warning array_values expects parameter 1 to be an array line 3635
This commit is contained in:
parent
c3ae524ed6
commit
e717daa467
@ -3630,11 +3630,18 @@ class mail_compose
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($contacts)) {
|
||||
foreach($contacts as $contact) {
|
||||
$cfs = $contacts_obj->read_customfields($contact['id'], $cfs_type_email);
|
||||
$cf_emails = $cfs ? (array)array_values(array_values($cfs)[0]) : array();
|
||||
foreach(array_merge(array($contact['email'],$contact['email_home']), $cf_emails) as $email) {
|
||||
if (is_array($contacts))
|
||||
{
|
||||
foreach($contacts as $contact)
|
||||
{
|
||||
$cf_emails = [];
|
||||
if ($cfs_type_email && ($cf_emails = $contacts_obj->read_customfields($contact['id'], $cfs_type_email)))
|
||||
{
|
||||
// cf_emails: [$contact['id'] => ['cf1'=>'email','cf2'=>'email2',...]]
|
||||
$cf_emails = array_values(reset($cf_emails));
|
||||
}
|
||||
foreach(array_merge(array($contact['email'],$contact['email_home']), $cf_emails) as $email)
|
||||
{
|
||||
// avoid wrong addresses, if an rfc822 encoded address is in addressbook
|
||||
//$email = preg_replace("/(^.*<)([a-zA-Z0-9_\-]+@[a-zA-Z0-9_\-\.]+)(.*)/",'$2',$email);
|
||||
$rfcAddr = Mail::parseAddressList($email);
|
||||
|
Loading…
Reference in New Issue
Block a user