Skip to content

Commit

Permalink
fix #272
Browse files Browse the repository at this point in the history
  • Loading branch information
egulias committed Nov 14, 2020
1 parent d37d5a3 commit db476db
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .phpunit.result.cache

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"pathMappings": {
"${workspaceFolder}": "${workspaceFolder}"
},
"port": 9000,
"log": true
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
2 changes: 2 additions & 0 deletions src/EmailLexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class EmailLexer extends AbstractLexer
const S_DOT = 46;
const S_DQUOTE = 34;
const S_SQUOTE = 39;
const S_BACKTICK = 96;
const S_OPENPARENTHESIS = 49;
const S_CLOSEPARENTHESIS = 261;
const S_OPENBRACKET = 262;
Expand Down Expand Up @@ -60,6 +61,7 @@ class EmailLexer extends AbstractLexer
',' => self::S_COMMA,
'.' => self::S_DOT,
"'" => self::S_SQUOTE,
"`" => self::S_BACKTICK,
'"' => self::S_DQUOTE,
'-' => self::S_HYPHEN,
'::' => self::S_DOUBLECOLON,
Expand Down
1 change: 1 addition & 0 deletions src/Parser/DomainPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ protected function checkDomainPartExceptions(array $prev)
$invalidDomainTokens = array(
EmailLexer::S_DQUOTE => true,
EmailLexer::S_SQUOTE => true,
EmailLexer::S_BACKTICK => 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 @@ -139,6 +139,7 @@ public function getTokens()
array(".", EmailLexer::S_DOT),
array("\"", EmailLexer::S_DQUOTE),
array("'", EmailLexer::S_SQUOTE),
array("`", EmailLexer::S_BACKTICK),
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 @@ -169,6 +169,7 @@ public function getInvalidEmails()
['test@ '],
['test@example.com []'],
["test@example.com'"],
["test@exam`ple.com"],
];
}

Expand Down

0 comments on commit db476db

Please sign in to comment.