Merge remote-tracking branch 'remotes/upstream/master' into 5.4

# Conflicts:
#	test/phpmailerTest.php
This commit is contained in:
Marcus Bointon 2015-12-22 09:35:50 +01:00
commit 32a99356ef
3 changed files with 22 additions and 3 deletions

View File

@ -13,6 +13,7 @@ This is a major update that breaks backwards compatibility. To emphasise that th
* `validateAddress()` is now called statically from `parseAddresses()`
* Fix gmail XOAUTH2 scope, thanks to @sherryl4george
* Fix extra line break in getSentMIMEMessage()
## Version 5.2.14 (Nov 1st 2015)
* Allow addresses with IDN (Internationalized Domain Name) in PHP 5.3+, thanks to @fbonzon

View File

@ -2056,7 +2056,7 @@ class PHPMailer
*/
public function getSentMIMEMessage()
{
return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody;
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody;
}
/**

View File

@ -605,8 +605,8 @@ class PHPMailerTest extends \PHPUnit_Framework_TestCase
'first.last@[IPv6::a2:a3:a4:b1:b2:b3:b4]',
'first.last@[IPv6:a1:a2:a3:a4::b1:b2:b3:b4]',
//This is valid RCC5322, but we don't want to allow it
"(\r\n RCPT TO:websec02@d.mbsd.jp\r\n DATA \\\nSubject: spam10\\\n\r\n".
" Hello,\r\n this is a spam mail.\\\n.\r\n QUIT\r\n ) a@gmail.com"
"(\r\n RCPT TO:user@example.com\r\n DATA \\\nSubject: spam10\\\n\r\n Hello," .
"\r\n this is a spam mail.\\\n.\r\n QUIT\r\n ) a@example.net"
];
// IDNs in Unicode and ASCII forms.
$unicodeaddresses = [
@ -1467,6 +1467,24 @@ EOT;
$this->assertTrue((strpos($b, 'To: "Tim \"The Book\" O\'Reilly" <foo@example.com>') !== false));
}
/**
* Test MIME structure assembly.
*/
public function testMIMEStructure()
{
$this->Mail->Subject .= ': MIME structure';
$this->Mail->Body = '<h3>MIME structure test.</h3>';
$this->Mail->AltBody = 'MIME structure test.';
$this->buildBody();
$this->Mail->preSend();
$this->assertRegExp(
"/Content-Transfer-Encoding: 8bit\r\n\r\n".
"This is a multi-part message in MIME format./",
$this->Mail->getSentMIMEMessage(),
'MIME structure broken'
);
}
/**
* Test BCC-only addressing.
*/