mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-09-04 14:38:21 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c81f18a3ef | |||
| 95979e2ad6 |
@@ -280,9 +280,9 @@ class DomainPart extends PartParser
|
|||||||
{
|
{
|
||||||
if ($this->lexer->token['type'] === EmailLexer::S_DOT || $isEndOfDomain) {
|
if ($this->lexer->token['type'] === EmailLexer::S_DOT || $isEndOfDomain) {
|
||||||
if ($this->isLabelTooLong($this->label)) {
|
if ($this->isLabelTooLong($this->label)) {
|
||||||
$this->label = '';
|
|
||||||
return new InvalidEmail(new LabelTooLong(), $this->lexer->token['value']);
|
return new InvalidEmail(new LabelTooLong(), $this->lexer->token['value']);
|
||||||
}
|
}
|
||||||
|
$this->label = '';
|
||||||
}
|
}
|
||||||
$this->label .= $this->lexer->token['value'];
|
$this->label .= $this->lexer->token['value'];
|
||||||
return new ValidEmail();
|
return new ValidEmail();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ interface EmailValidation
|
|||||||
/**
|
/**
|
||||||
* Returns the validation error.
|
* Returns the validation error.
|
||||||
*
|
*
|
||||||
* @return InvalidEmail
|
* @return InvalidEmail|null
|
||||||
*/
|
*/
|
||||||
public function getError() : ?InvalidEmail;
|
public function getError() : ?InvalidEmail;
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class RFCValidationDomainPartTest extends TestCase
|
|||||||
['validipv4@[127.0.0.0]'],
|
['validipv4@[127.0.0.0]'],
|
||||||
['validipv4@127.0.0.0'],
|
['validipv4@127.0.0.0'],
|
||||||
['withhyphen@domain-exam.com'],
|
['withhyphen@domain-exam.com'],
|
||||||
|
['valid_long_domain@71846jnrsoj91yfhc18rkbrf90ue3onl8y46js38kae8inz0t1.5a-xdycuau.na49.le.example.com']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user