diff options
author | Andreas Gohr <andi@splitbrain.org> | 2008-10-11 16:14:42 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2008-10-11 16:14:42 +0200 |
commit | 2300b3e6e4670b6b7e8c1ec9f40abc0d3e99a58a (patch) | |
tree | a0ab1e36cee97c8fbd3436f409ccec75614cbe68 /inc/mail.php | |
parent | 6fe2045347578cad6b88412ce6effdd77d079d42 (diff) | |
download | rpg-2300b3e6e4670b6b7e8c1ec9f40abc0d3e99a58a.tar.gz rpg-2300b3e6e4670b6b7e8c1ec9f40abc0d3e99a58a.tar.bz2 |
some changes for the recent FS#1419 and FS#1375 fixes
very simple unit test added. Still needs *real world* testing!
darcs-hash:20081011141442-7ad00-13378a7a14f81b0799102f0d53d6db8e1078b3e0.gz
Diffstat (limited to 'inc/mail.php')
-rw-r--r-- | inc/mail.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/inc/mail.php b/inc/mail.php index 5cd7db13d..4b27963ee 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -73,8 +73,8 @@ function _mail_send_action($data) { // On Unix set the envelope headers correctly: if($usenames){ - if($from) $params = ((string) $params).' -f '.escapeshellarg($from); - if($to) $params = ((string) $params).' '.escapeshellarg($to); + if($from) $params = ((string) $params).' -f '.escapeshellarg(mail_encode_address($from,'',false)); + if($to) $params = ((string) $params).' '.escapeshellarg(mail_encode_address($to,'',false)); } $to = mail_encode_address($to,'',$usenames); @@ -157,8 +157,11 @@ function mail_encode_address($string,$header='',$names=true){ $text = ''; } - // add to header comma seperated and in new line to avoid too long headers - if($headers != '') $headers .= ','.MAILHEADER_EOL.' '; + // add to header comma seperated + if($headers != ''){ + $headers .= ','; + if($header) $headers .= MAILHEADER_EOL.' '; // avoid overlong mail headers + } $headers .= $text.' '.$addr; } |