Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
04a3cb9f
Commit
04a3cb9f
authored
Oct 02, 2006
by
pookey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pookey: fixed email validator and added more test cases
parent
8abb9795
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
Email.php
lib/Doctrine/Validator/Email.php
+2
-2
ValidatorTestCase.php
tests/ValidatorTestCase.php
+3
-0
No files found.
lib/Doctrine/Validator/Email.php
View file @
04a3cb9f
...
...
@@ -29,9 +29,9 @@ class Doctrine_Validator_Email {
$domain_literal
=
"
\\
x5b(
$dtext
|
$quoted_pair
)*
\\
x5d"
;
$quoted_string
=
"
\\
x22(
$qtext
|
$quoted_pair
)*
\\
x22"
;
$domain_ref
=
$atom
;
$sub_domain
=
"(
$domain_ref
|
$domain_literal
)"
;
$sub_domain
=
"(
$domain_ref
|
$domain_literal
)"
;
$word
=
"(
$atom
|
$quoted_string
)"
;
$domain
=
"
$sub_domain
(
\\
x2e
$sub_domain
)
*
"
;
$domain
=
"
$sub_domain
(
\\
x2e
$sub_domain
)
+
"
;
$local_part
=
"
$word
(
\\
x2e
$word
)*"
;
$addr_spec
=
"
$local_part
\\
x40
$domain
"
;
...
...
tests/ValidatorTestCase.php
View file @
04a3cb9f
...
...
@@ -143,6 +143,9 @@ class Doctrine_ValidatorTestCase extends Doctrine_UnitTestCase {
$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
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment