From 0ae225615c5101c66d3e51005a9d7270b47d7a20 Mon Sep 17 00:00:00 2001 From: ndm2 Date: Sat, 15 Mar 2014 11:47:13 +0100 Subject: [PATCH] Match SP as per rfc2821 --- lib/Cake/Network/Email/SmtpTransport.php | 2 +- lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Network/Email/SmtpTransport.php b/lib/Cake/Network/Email/SmtpTransport.php index 8843e655e..d2587038c 100644 --- a/lib/Cake/Network/Email/SmtpTransport.php +++ b/lib/Cake/Network/Email/SmtpTransport.php @@ -133,7 +133,7 @@ class SmtpTransport extends AbstractTransport { protected function _bufferResponseLines(array $responseLines) { $response = array(); foreach ($responseLines as $responseLine) { - if (preg_match('/^(\d{3})(?:[\s\-]+(.*))?$/', $responseLine, $match)) { + if (preg_match('/^(\d{3})(?:[ -]+(.*))?$/', $responseLine, $match)) { $response[] = array( 'code' => $match[1], 'message' => isset($match[2]) ? $match[2] : null diff --git a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php index 0d921b7ee..1eecd8893 100644 --- a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php @@ -431,6 +431,7 @@ class SmtpTransportTest extends CakeTestCase { public function testBufferResponseLines() { $reponseLines = array( '123', + "456\tFOO", 'FOOBAR', '250-PIPELINING', '250-ENHANCEDSTATUSCODES',