fix for imap_rfc822_write_address from imap extension

This commit is contained in:
Ralf Becker 2015-06-09 08:54:23 +00:00
parent e5e330034f
commit d2eee09ff2
2 changed files with 9 additions and 3 deletions

View File

@ -1487,7 +1487,9 @@ class addressbook_bo extends addressbook_so
// make sure to return a correctly quoted rfc822 address, if requested // make sure to return a correctly quoted rfc822 address, if requested
if ($options['type'] === 'email') 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 // show category color
if ($contact['cat_id'] && ($color = etemplate::cats2color($contact['cat_id']))) if ($contact['cat_id'] && ($color = etemplate::cats2color($contact['cat_id'])))

View File

@ -3314,7 +3314,9 @@ class mail_compose
{ {
$contact['n_fn'] = str_replace(array(',','@'),' ',$contact['n_fn']); $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) { if(!empty($email) && in_array($completeMailString ,$results) === false) {
$results[] = array( $results[] = array(
'id'=>$completeMailString, 'id'=>$completeMailString,
@ -3335,7 +3337,9 @@ class mail_compose
{ {
$group = $GLOBALS['egw']->accounts->read($g_id); $group = $GLOBALS['egw']->accounts->read($g_id);
if(!$group['account_email']) continue; 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( $results[] = array(
'id' => $completeMailString, 'id' => $completeMailString,
'label' => $completeMailString, 'label' => $completeMailString,