missing handling of decoding in emailAddressToHTML;

This commit is contained in:
Klaus Leithoff 2010-09-10 14:14:23 +00:00
parent d1b8b8f0c4
commit 1f956a6264

View File

@ -419,24 +419,24 @@
// sent by a mailinglist??
// parse the from header
if($envelope['FROM'][0] != $envelope['SENDER'][0]) {
$senderAddress = self::emailAddressToHTML($envelope['SENDER']);
$fromAddress = self::emailAddressToHTML($envelope['FROM'], $organization);
$senderAddress = self::emailAddressToHTML($envelope['SENDER'],'',false,true,false);
$fromAddress = self::emailAddressToHTML($envelope['FROM'], $organization,false,true,false);
$this->t->set_var("from_data",$senderAddress);
$this->t->set_var("onbehalfof_data",$fromAddress);
$this->t->parse('on_behalf_of_part','message_onbehalfof',True);
} else {
$fromAddress = self::emailAddressToHTML($envelope['FROM'], $organization);
$fromAddress = self::emailAddressToHTML($envelope['FROM'], $organization,false,true,false);
$this->t->set_var("from_data", $fromAddress);
$this->t->set_var('on_behalf_of_part','');
}
// parse the to header
$toAddress = self::emailAddressToHTML($envelope['TO']);
$toAddress = self::emailAddressToHTML($envelope['TO'],'',false,true,false);
$this->t->set_var("to_data",$toAddress);
// parse the cc header
if(count($envelope['CC'])) {
$ccAddress = self::emailAddressToHTML($envelope['CC']);
$ccAddress = self::emailAddressToHTML($envelope['CC'],'',false,true,false);
$this->t->set_var("cc_data",$ccAddress);
$this->t->parse('cc_data_part','message_cc',True);
} else {
@ -445,7 +445,7 @@
// parse the bcc header
if(count($envelope['BCC'])) {
$bccAddress = self::emailAddressToHTML($envelope['BCC']);
$bccAddress = self::emailAddressToHTML($envelope['BCC'],'',false,true,false);
$this->t->set_var("bcc_data",$bccAddress);
$this->t->parse('bcc_data_part','message_bcc',True);
} else {
@ -952,7 +952,7 @@
$GLOBALS['egw']->common->egw_header();
}
static function emailAddressToHTML($_emailAddress, $_organisation='', $allwaysShowMailAddress=false, $showAddToAdrdessbookLink=true) {
static function emailAddressToHTML($_emailAddress, $_organisation='', $allwaysShowMailAddress=false, $showAddToAdrdessbookLink=true, $decode=true) {
#_debug_array($_emailAddress);
// create some nice formated HTML for senderaddress
#if($_emailAddress['EMAIL'] == 'undisclosed-recipients: ;')
@ -977,8 +977,8 @@
if($addressData['PERSONAL_NAME'] != 'NIL') {
$newSenderAddress = $addressData['RFC822_EMAIL'] != 'NIL' ? $addressData['RFC822_EMAIL'] : $addressData['EMAIL'];
$newSenderAddress = bofelamimail::decode_header($newSenderAddress);
$decodedPersonalName = bofelamimail::decode_header($addressData['PERSONAL_NAME']);
if ($decode) $newSenderAddress = bofelamimail::decode_header($newSenderAddress);
$decodedPersonalName = ($decode ? bofelamimail::decode_header($addressData['PERSONAL_NAME']):$addressData['PERSONAL_NAME']);
$realName = $decodedPersonalName;
// add mailaddress
@ -1414,24 +1414,24 @@
$this->translate();
if($envelope['FROM'][0] != $envelope['SENDER'][0]) {
$senderAddress = self::emailAddressToHTML($envelope['SENDER'], '', true, false);
$fromAddress = self::emailAddressToHTML($envelope['FROM'], $organization, true, false);
$senderAddress = self::emailAddressToHTML($envelope['SENDER'], '', true, false,false);
$fromAddress = self::emailAddressToHTML($envelope['FROM'], $organization, true, false,false);
$this->t->set_var("from_data",$senderAddress);
$this->t->set_var("onbehalfof_data",$fromAddress);
$this->t->parse('on_behalf_of_part','message_onbehalfof',True);
} else {
$fromAddress = self::emailAddressToHTML($envelope['FROM'], $organization, true, false);
$fromAddress = self::emailAddressToHTML($envelope['FROM'], $organization, true, false,false);
$this->t->set_var("from_data", $fromAddress);
$this->t->set_var('on_behalf_of_part','');
}
// parse the to header
$toAddress = self::emailAddressToHTML($envelope['TO'], '', true, false);
$toAddress = self::emailAddressToHTML($envelope['TO'], '', true, false,false);
$this->t->set_var("to_data",$toAddress);
// parse the cc header
if(count($envelope['CC'])) {
$ccAddress = self::emailAddressToHTML($envelope['CC'], '', true, false);
$ccAddress = self::emailAddressToHTML($envelope['CC'], '', true, false,false);
$this->t->set_var("cc_data",$ccAddress);
$this->t->parse('cc_data_part','message_cc',True);
} else {