diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index 15db67455..8733a6675 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -597,7 +597,8 @@ class CakeEmail { protected function _validateEmail($email) { if ($this->_emailPattern === null && filter_var($email, FILTER_VALIDATE_EMAIL)) { return; - } elseif (preg_match($this->_emailPattern, $email)) { + } + if (preg_match($this->_emailPattern, $email)) { return; } throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $email)); diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index 76be238c2..508c9ef36 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -267,6 +267,7 @@ class CakeEmailTest extends CakeTestCase { $this->CakeEmail->addTo('jrbasso@cakephp.org'); $this->CakeEmail->addTo('mark_story@cakephp.org', 'Mark Story'); + $this->CakeEmail->addTo('foobar@ætdcadsl.dk'); $result = $this->CakeEmail->addTo(array('phpnut@cakephp.org' => 'PhpNut', 'jose_zap@cakephp.org')); $expected = array( 'root@localhost' => 'root', @@ -276,6 +277,7 @@ class CakeEmailTest extends CakeTestCase { 'root@cakephp.org' => 'root@cakephp.org', 'jrbasso@cakephp.org' => 'jrbasso@cakephp.org', 'mark_story@cakephp.org' => 'Mark Story', + 'foobar@ætdcadsl.dk' => 'foobar@ætdcadsl.dk', 'phpnut@cakephp.org' => 'PhpNut', 'jose_zap@cakephp.org' => 'jose_zap@cakephp.org' );