mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Merge pull request #4624 from cakephp/master-email
Add intl email test. Closes #4623
This commit is contained in:
commit
d0b78e78ca
2 changed files with 4 additions and 1 deletions
|
@ -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));
|
||||
|
|
|
@ -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'
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue