Skip to content

Commit

Permalink
Avoid double-encoding subject if mbstring overloads mail function, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Nov 11, 2013
1 parent 6730be8 commit 024c4f3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,16 @@ public function __destruct()
*/
private function mailPassthru($to, $subject, $body, $header, $params)
{
//Check overloading of mail function to avoid double-encoding
if (ini_get('mbstring.func_overload') & 1) {
$subject = $this->secureHeader($subject);
} else {
$subject = $this->encodeHeader($this->secureHeader($subject));
}
if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
$rt = @mail($to, $this->encodeHeader($this->secureHeader($subject)), $body, $header);
$rt = @mail($to, $subject, $body, $header);
} else {
$rt = @mail($to, $this->encodeHeader($this->secureHeader($subject)), $body, $header, $params);
$rt = @mail($to, $subject, $body, $header, $params);
}
return $rt;
}
Expand Down

0 comments on commit 024c4f3

Please sign in to comment.