Skip to content

Commit

Permalink
Port of #268 (from #215)
Browse files Browse the repository at this point in the history
  • Loading branch information
egulias committed Oct 17, 2020
1 parent cbe0d20 commit af96d07
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/EmailLexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class EmailLexer extends AbstractLexer
const S_BACKSLASH = 92;
const S_DOT = 46;
const S_DQUOTE = 34;
const S_SQUOTE = 39;
const S_OPENPARENTHESIS = 49;
const S_CLOSEPARENTHESIS = 261;
const S_OPENBRACKET = 262;
Expand Down Expand Up @@ -59,6 +60,7 @@ class EmailLexer extends AbstractLexer
',' => self::S_COMMA,
'.' => self::S_DOT,
'"' => self::S_DQUOTE,
"'" => self::S_SQUOTE,
'-' => self::S_HYPHEN,
'::' => self::S_DOUBLECOLON,
' ' => self::S_SP,
Expand Down
1 change: 1 addition & 0 deletions src/Parser/DomainPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ protected function checkDomainPartExceptions(array $prev)
{
$invalidDomainTokens = array(
EmailLexer::S_DQUOTE => true,
EmailLexer::S_SQUOTE => true,
EmailLexer::S_SEMICOLON => true,
EmailLexer::S_GREATERTHAN => true,
EmailLexer::S_LOWERTHAN => true,
Expand Down
1 change: 1 addition & 0 deletions tests/EmailValidator/EmailLexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public function getTokens()
array(":", EmailLexer::S_COLON),
array(".", EmailLexer::S_DOT),
array("\"", EmailLexer::S_DQUOTE),
array("'", EmailLexer::S_SQUOTE),
array("-", EmailLexer::S_HYPHEN),
array("\\", EmailLexer::S_BACKSLASH),
array("/", EmailLexer::S_SLASH),
Expand Down
1 change: 1 addition & 0 deletions tests/EmailValidator/Validation/RFCValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public function getInvalidEmails()
['test@example.com []'],
['test@example.com. []'],
['test@test. example.com'],
["test@example.com'"],
];
}

Expand Down

0 comments on commit af96d07

Please sign in to comment.