Avoid potentially double encoding already utf-8 encoded messages
This commit is contained in:
parent
5aa303320b
commit
f3352254b7
@ -301,7 +301,7 @@ class MailerDaemon
|
||||
|
||||
$this->extract_part($parsed,$msg,$attachments);
|
||||
|
||||
return array($from, $to, utf8_encode($msg), $attachments);
|
||||
return array($from, $to, $msg, $attachments);
|
||||
}
|
||||
|
||||
function extract_part($parsed,&$msg,&$attachments){
|
||||
@ -317,6 +317,9 @@ class MailerDaemon
|
||||
} else if ($parsed->ctype_primary == 'text'
|
||||
&& $parsed->ctype_secondary=='plain') {
|
||||
$msg = $parsed->body;
|
||||
if(strtolower($parsed->ctype_parameters['charset']) != "utf-8"){
|
||||
$msg = utf8_encode($msg);
|
||||
}
|
||||
}else if(!empty($parsed->body)){
|
||||
if(common_config('attachments', 'uploads')){
|
||||
//only save attachments if uploads are enabled
|
||||
|
Loading…
Reference in New Issue
Block a user