Commit 04a3cb9f authored by pookey's avatar pookey

pookey: fixed email validator and added more test cases

parent 8abb9795
...@@ -31,7 +31,7 @@ class Doctrine_Validator_Email { ...@@ -31,7 +31,7 @@ class Doctrine_Validator_Email {
$domain_ref = $atom; $domain_ref = $atom;
$sub_domain = "($domain_ref|$domain_literal)"; $sub_domain = "($domain_ref|$domain_literal)";
$word = "($atom|$quoted_string)"; $word = "($atom|$quoted_string)";
$domain = "$sub_domain(\\x2e$sub_domain)*"; $domain = "$sub_domain(\\x2e$sub_domain)+";
$local_part = "$word(\\x2e$word)*"; $local_part = "$word(\\x2e$word)*";
$addr_spec = "$local_part\\x40$domain"; $addr_spec = "$local_part\\x40$domain";
......
...@@ -143,6 +143,9 @@ class Doctrine_ValidatorTestCase extends Doctrine_UnitTestCase { ...@@ -143,6 +143,9 @@ class Doctrine_ValidatorTestCase extends Doctrine_UnitTestCase {
$this->assertFalse($validator->validate($email,"address","example@e..",null)); $this->assertFalse($validator->validate($email,"address","example@e..",null));
$this->assertTrue($validator->validate($email,"address","null@pookey.co.uk",null));
$this->assertTrue($validator->validate($email,"address","null@pookey.com",null));
$this->assertTrue($validator->validate($email,"address","null@users.doctrine.pengus.net",null));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment