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:
John Congdon
2021-04-01 11:37:14 -07:00
committed by GitHub
parent 95979e2ad6
commit c81f18a3ef
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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();