diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index 34aa7347e0..5355b9c938 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -1487,7 +1487,9 @@ class addressbook_bo extends addressbook_so // make sure to return a correctly quoted rfc822 address, if requested if ($options['type'] === 'email') { - $result[$contact['id']] = imap_rfc822_write_address($contact['email'], '', $result[$contact['id']]); + $args = explode('@', $contact['email']); + $args[] = $result[$contact['id']]; + $result[$contact['id']] = call_user_func_array('imap_rfc822_write_address', $args); } // show category color if ($contact['cat_id'] && ($color = etemplate::cats2color($contact['cat_id']))) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index b39c7e1014..4bc11324ff 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -3314,7 +3314,9 @@ class mail_compose { $contact['n_fn'] = str_replace(array(',','@'),' ',$contact['n_fn']); } - $completeMailString = imap_rfc822_write_address(trim($email), '', trim($contact['n_fn'] ? $contact['n_fn'] : $contact['fn'])); + $args = explode('@', trim($email)); + $args[] = trim($contact['n_fn'] ? $contact['n_fn'] : $contact['fn']); + $completeMailString = call_user_func_array('imap_rfc822_write_address', $args); if(!empty($email) && in_array($completeMailString ,$results) === false) { $results[] = array( 'id'=>$completeMailString, @@ -3335,7 +3337,9 @@ class mail_compose { $group = $GLOBALS['egw']->accounts->read($g_id); if(!$group['account_email']) continue; - $completeMailString = imap_rfc822_write_address(trim($group['account_email']), '', $name); + $args = explode('@', trim($group['account_email'])); + $args[] = $name; + $completeMailString = call_user_func_array('imap_rfc822_write_address', $args); $results[] = array( 'id' => $completeMailString, 'label' => $completeMailString,