mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-09-01 13:08:58 +00:00
Reset the label when a S_DOT is encountered. (#297)
This will allow multi label domain's to still validate correctly. Reset the label when a S_DOT is encountered.
This commit is contained in:
@@ -280,9 +280,9 @@ class DomainPart extends PartParser
|
||||
{
|
||||
if ($this->lexer->token['type'] === EmailLexer::S_DOT || $isEndOfDomain) {
|
||||
if ($this->isLabelTooLong($this->label)) {
|
||||
$this->label = '';
|
||||
return new InvalidEmail(new LabelTooLong(), $this->lexer->token['value']);
|
||||
}
|
||||
$this->label = '';
|
||||
}
|
||||
$this->label .= $this->lexer->token['value'];
|
||||
return new ValidEmail();
|
||||
|
||||
@@ -76,6 +76,7 @@ class RFCValidationDomainPartTest extends TestCase
|
||||
['validipv4@[127.0.0.0]'],
|
||||
['validipv4@127.0.0.0'],
|
||||
['withhyphen@domain-exam.com'],
|
||||
['valid_long_domain@71846jnrsoj91yfhc18rkbrf90ue3onl8y46js38kae8inz0t1.5a-xdycuau.na49.le.example.com']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user