mirror of
https://github.com/PHPMailer/PHPMailer.git
synced 2024-09-20 18:03:04 +02:00
Merge branch 'master' of https://github.com/PHPMailer/PHPMailer
This commit is contained in:
commit
4f62497920
@ -1,5 +1,7 @@
|
||||
# PHPMailer Change Log
|
||||
|
||||
* Correct DKIM canonicalization of line breaks for header & body - thanks to @themichaelhall
|
||||
|
||||
## Version 6.0.2 (November 29th 2017)
|
||||
* Don't make max line length depend on line break format
|
||||
* Improve Travis-CI config - thanks to Filippo Tessarotto
|
||||
|
@ -4049,7 +4049,7 @@ class PHPMailer
|
||||
// Normalise to \n
|
||||
$text = str_replace(["\r\n", "\r"], "\n", $text);
|
||||
// Now convert LE as needed
|
||||
if ("\n" !== static::$LE) {
|
||||
if ("\n" !== $breaktype) {
|
||||
$text = str_replace("\n", $breaktype, $text);
|
||||
}
|
||||
|
||||
@ -4154,6 +4154,7 @@ class PHPMailer
|
||||
/**
|
||||
* Generate a DKIM canonicalization header.
|
||||
* Uses the 'relaxed' algorithm from RFC6376 section 3.4.2.
|
||||
* Canonicalized headers should *always* use CRLF, regardless of mailer setting.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc6376#section-3.4.2
|
||||
*
|
||||
@ -4189,12 +4190,13 @@ class PHPMailer
|
||||
$lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t");
|
||||
}
|
||||
|
||||
return implode(static::$LE, $lines);
|
||||
return implode("\r\n", $lines);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a DKIM canonicalization body.
|
||||
* Uses the 'simple' algorithm from RFC6376 section 3.4.3.
|
||||
* Canonicalized bodies should *always* use CRLF, regardless of mailer setting.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc6376#section-3.4.3
|
||||
*
|
||||
@ -4205,13 +4207,13 @@ class PHPMailer
|
||||
public function DKIM_BodyC($body)
|
||||
{
|
||||
if (empty($body)) {
|
||||
return static::$LE;
|
||||
return "\r\n";
|
||||
}
|
||||
// Normalize line endings
|
||||
$body = static::normalizeBreaks($body);
|
||||
// Normalize line endings to CRLF
|
||||
$body = static::normalizeBreaks($body, "\r\n");
|
||||
|
||||
//Reduce multiple trailing line breaks to a single one
|
||||
return rtrim($body, "\r\n") . static::$LE;
|
||||
return rtrim($body, "\r\n") . "\r\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user