mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-09-04 14:38:21 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fa792ad18 |
+2
-1
@@ -31,7 +31,7 @@ matrix:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- if [ "$deps" = "low" ]; then composer update --prefer-lowest; else composer install; fi
|
- if [ "$deps" = "low" ]; then composer update --prefer-lowest; else composer install; fi
|
||||||
- if [ "$psalm" = "yes" ]; then composer require --dev vimeo/psalm; fi
|
- if [ "$psalm" = "yes" ]; then composer require --dev vimeo/psalm:3.18.2; fi
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir -p build/logs
|
- mkdir -p build/logs
|
||||||
@@ -42,3 +42,4 @@ script:
|
|||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- php vendor/bin/coveralls
|
- php vendor/bin/coveralls
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class EmailLexer extends AbstractLexer
|
|||||||
const S_BACKSLASH = 92;
|
const S_BACKSLASH = 92;
|
||||||
const S_DOT = 46;
|
const S_DOT = 46;
|
||||||
const S_DQUOTE = 34;
|
const S_DQUOTE = 34;
|
||||||
|
const S_SQUOTE = 39;
|
||||||
const S_OPENPARENTHESIS = 49;
|
const S_OPENPARENTHESIS = 49;
|
||||||
const S_CLOSEPARENTHESIS = 261;
|
const S_CLOSEPARENTHESIS = 261;
|
||||||
const S_OPENBRACKET = 262;
|
const S_OPENBRACKET = 262;
|
||||||
@@ -58,6 +59,7 @@ class EmailLexer extends AbstractLexer
|
|||||||
'/' => self::S_SLASH,
|
'/' => self::S_SLASH,
|
||||||
',' => self::S_COMMA,
|
',' => self::S_COMMA,
|
||||||
'.' => self::S_DOT,
|
'.' => self::S_DOT,
|
||||||
|
"'" => self::S_SQUOTE,
|
||||||
'"' => self::S_DQUOTE,
|
'"' => self::S_DQUOTE,
|
||||||
'-' => self::S_HYPHEN,
|
'-' => self::S_HYPHEN,
|
||||||
'::' => self::S_DOUBLECOLON,
|
'::' => self::S_DOUBLECOLON,
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ class DomainPart extends Parser
|
|||||||
{
|
{
|
||||||
$invalidDomainTokens = array(
|
$invalidDomainTokens = array(
|
||||||
EmailLexer::S_DQUOTE => true,
|
EmailLexer::S_DQUOTE => true,
|
||||||
|
EmailLexer::S_SQUOTE => true,
|
||||||
EmailLexer::S_SEMICOLON => true,
|
EmailLexer::S_SEMICOLON => true,
|
||||||
EmailLexer::S_GREATERTHAN => true,
|
EmailLexer::S_GREATERTHAN => true,
|
||||||
EmailLexer::S_LOWERTHAN => true,
|
EmailLexer::S_LOWERTHAN => true,
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class DNSCheckValidation implements EmailValidation
|
|||||||
|
|
||||||
|
|
||||||
// No MX, A or AAAA DNS records
|
// No MX, A or AAAA DNS records
|
||||||
if (empty($dnsRecords) || !$dnsRecords) {
|
if (empty($dnsRecords)) {
|
||||||
$this->error = new NoDNSRecord();
|
$this->error = new NoDNSRecord();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ class EmailLexerTests extends TestCase
|
|||||||
array(":", EmailLexer::S_COLON),
|
array(":", EmailLexer::S_COLON),
|
||||||
array(".", EmailLexer::S_DOT),
|
array(".", EmailLexer::S_DOT),
|
||||||
array("\"", EmailLexer::S_DQUOTE),
|
array("\"", EmailLexer::S_DQUOTE),
|
||||||
|
array("'", EmailLexer::S_SQUOTE),
|
||||||
array("-", EmailLexer::S_HYPHEN),
|
array("-", EmailLexer::S_HYPHEN),
|
||||||
array("\\", EmailLexer::S_BACKSLASH),
|
array("\\", EmailLexer::S_BACKSLASH),
|
||||||
array("/", EmailLexer::S_SLASH),
|
array("/", EmailLexer::S_SLASH),
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ class RFCValidationTest extends TestCase
|
|||||||
['test@email{'],
|
['test@email{'],
|
||||||
['test@ '],
|
['test@ '],
|
||||||
['test@example.com []'],
|
['test@example.com []'],
|
||||||
|
["test@example.com'"],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,6 +213,7 @@ class RFCValidationTest extends TestCase
|
|||||||
[new CRNoLF(), "example@exa\rmple.co.uk"],
|
[new CRNoLF(), "example@exa\rmple.co.uk"],
|
||||||
[new CRNoLF(), "example@[\r]"],
|
[new CRNoLF(), "example@[\r]"],
|
||||||
[new CRNoLF(), "exam\rple@example.co.uk"],
|
[new CRNoLF(), "exam\rple@example.co.uk"],
|
||||||
|
[new ExpectingATEXT(), "test@example.com'"],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user