diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index 3574e66c8a..0fd463b89c 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 61d2d3bf58..00aa5558e9 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -3294,7 +3294,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, @@ -3315,7 +3317,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,