From b3f55bfd29de80d2cee560db0bdc7466e7a4734d Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sat, 11 Dec 2010 13:23:23 -0800 Subject: [PATCH 1/2] Added shorter timeout to fsockopen checks --- .../libs/controller/components/email.test.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index f8fd2e4a5..1dafc9b42 100755 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -268,7 +268,7 @@ class EmailComponentTest extends CakeTestCase { * @return void */ function testSmtpConfig() { - if ($this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + if ($this->skipIf(!@fsockopen('localhost', 25, $err, $errstr, .01), '%s No SMTP server running on localhost')) { return; } $this->Controller->EmailTest->delivery = 'smtp'; @@ -295,7 +295,7 @@ class EmailComponentTest extends CakeTestCase { * @return void */ function testBadSmtpSend() { - if ($this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + if ($this->skipIf(!@fsockopen('localhost', 25, $err, $errstr, .01), '%s No SMTP server running on localhost')) { return; } $this->Controller->EmailTest->smtpOptions['host'] = 'blah'; @@ -310,7 +310,7 @@ class EmailComponentTest extends CakeTestCase { * @return void */ function testSmtpSend() { - if ($this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + if ($this->skipIf(!@fsockopen('localhost', 25, $err, $errstr, .01), '%s No SMTP server running on localhost')) { return; } @@ -359,7 +359,7 @@ TEMPDOC; * @return void */ function testSmtpEhlo() { - if ($this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + if ($this->skipIf(!@fsockopen('localhost', 25, $err, $errstr, .01), '%s No SMTP server running on localhost')) { return; } @@ -416,7 +416,7 @@ TEMPDOC; * @return void */ function testSmtpSendMultipleTo() { - if ($this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + if ($this->skipIf(!@fsockopen('localhost', 25, $err, $errstr, .01), '%s No SMTP server running on localhost')) { return; } $this->Controller->EmailTest->reset(); @@ -465,7 +465,7 @@ TEMPDOC; * @return void */ function testAuthenticatedSmtpSend() { - if ($this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + if ($this->skipIf(!@fsockopen('localhost', 25, $err, $errstr, .01), '%s No SMTP server running on localhost')) { return; } @@ -658,7 +658,7 @@ TEXTBLOC; * @return void */ function testSmtpSendSocket() { - if ($this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + if ($this->skipIf(!@fsockopen('localhost', 25, $err, $errstr, .01), '%s No SMTP server running on localhost')) { return; } From 7ed19eae88043e72c737144b077d3a8e1dcc50fc Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sat, 11 Dec 2010 15:11:54 -0800 Subject: [PATCH 2/2] Allowed comma-delimited list in smtp $to var to be consistent with standard mail delivery. Fixes #1353 --- cake/libs/controller/components/email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index a4cb6dd02..76fbee04e 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -861,7 +861,7 @@ class EmailComponent extends Component { } if (!is_array($this->to)) { - $tos = array($this->to); + $tos = array_map('trim', explode(',', $this->to)); } else { $tos = $this->to; }