Avoid double-encoding subject if mbstring overloads mail function, fixes #133
This commit is contained in:
parent
6730be8f10
commit
024c4f314c
|
|
@ -602,10 +602,16 @@ class PHPMailer
|
|||
*/
|
||||
private function mailPassthru($to, $subject, $body, $header, $params)
|
||||
{
|
||||
if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
|
||||
$rt = @mail($to, $this->encodeHeader($this->secureHeader($subject)), $body, $header);
|
||||
//Check overloading of mail function to avoid double-encoding
|
||||
if (ini_get('mbstring.func_overload') & 1) {
|
||||
$subject = $this->secureHeader($subject);
|
||||
} else {
|
||||
$rt = @mail($to, $this->encodeHeader($this->secureHeader($subject)), $body, $header, $params);
|
||||
$subject = $this->encodeHeader($this->secureHeader($subject));
|
||||
}
|
||||
if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
|
||||
$rt = @mail($to, $subject, $body, $header);
|
||||
} else {
|
||||
$rt = @mail($to, $subject, $body, $header, $params);
|
||||
}
|
||||
return $rt;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue