-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
For a TXT record like example.org. TXT 300 v=spf1 mx include:spf.example.com -all
the parser ignores the content after the first space.
TXT records are allowed to have multiple "character strings" so this behaviour is valid
I replaced the fromText method to resolve the issue. This also fixes content with multiple quoted strings, like "foo bar" "foo baz"
public function fromText(string $text): void
{
$string = new StringIterator($text);
$txt = new StringIterator();
while ($string->valid()) {
if ($string->is(static::WHITESPACE)) {
$string->next();
continue;
}
if ($string->is(Tokens::DOUBLE_QUOTES)) {
self::handleTxt($string, $txt);
$string->next();
$txt->append(' ');
continue;
}
static::handleContiguousString($string, $txt);
$string->next();
$txt->append(' ');
}
$this->setText(trim((string) $txt), true);
}
Metadata
Metadata
Assignees
Labels
No labels