Upstream PHPMailer/PHPMailer state of the touched files before 5b7250d8da
This commit is contained in:
1 parent
1ac61eecb6
commit
ce1b3ed5e6
1 file changed
+6
-8
+6
-8
@@ -2090,8 +2090,7 @@ class PHPMailer
|
||||
foreach ($this->to as $toaddr) {
|
||||
$toArr[] = $this->addrFormat($toaddr);
|
||||
}
|
||||
//Fold long lists the same way as the To header, mail() keeps CRLF + WSP folds intact
|
||||
$to = trim(substr($this->addrAppend('To', $this->to), strlen('To:')));
|
||||
$to = trim(implode(', ', $toArr));
|
||||
|
||||
//If there are no To-addresses (e.g. when sending only to BCC-addresses)
|
||||
//the following should be added to get a correct DKIM-signature.
|
||||
@@ -2648,18 +2647,17 @@ class PHPMailer
|
||||
$addresses[] = $this->addrFormat($address);
|
||||
}
|
||||
|
||||
//Fold between addresses so that no line exceeds the RFC 2822 line length limit
|
||||
//Fold between addresses so that no line exceeds the RFC 5322 limit,
|
||||
//leaving room for the comma at the end of a folded line
|
||||
$header = $type . ': ' . array_shift($addresses);
|
||||
$lineLength = strlen($header);
|
||||
foreach ($addresses as $address) {
|
||||
//The address goes after ', ' and must still leave room for the ',' that ends
|
||||
//the line if the next address gets folded
|
||||
if ($lineLength + strlen(', ') + strlen($address) + strlen(',') > static::MAX_LINE_LENGTH) {
|
||||
if ($lineLength + strlen($address) + 3 > static::MAX_LINE_LENGTH) {
|
||||
$header .= ',' . static::$LE . ' ' . $address;
|
||||
$lineLength = strlen(' ') + strlen($address);
|
||||
$lineLength = strlen($address) + 1;
|
||||
} else {
|
||||
$header .= ', ' . $address;
|
||||
$lineLength += strlen(', ') + strlen($address);
|
||||
$lineLength += strlen($address) + 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user