Skip to content

Commit

Permalink
Fix TXT records without quotation marks
Browse files Browse the repository at this point in the history
Inspired by this comment: Badcow#116
  • Loading branch information
Spirit55555 authored Jun 2, 2024
1 parent 18557bc commit 763facb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Rdata/TXT.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ public function fromText(string $text): void
if ($string->is(Tokens::DOUBLE_QUOTES)) {
self::handleTxt($string, $txt);
$string->next();
$txt->append(' ');
continue;
}

self::handleContiguousString($string, $txt);
break;
$string->next();
$txt->append(' ');
}

$this->setText((string) $txt, true);
Expand Down

2 comments on commit 763facb

@mfeske
Copy link

@mfeske mfeske commented on 763facb Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. However, this only partially solves the problem. If a TXT entry is set without double quotation marks and contains a semicolon, the entry is canceled.
from
TXT v=DKIM1; k=rsa; 123456
becomes
TXT v=DKIM1

@Spirit55555
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. However, this only partially solves the problem. If a TXT entry is set without double quotation marks and contains a semicolon, the entry is canceled. from TXT v=DKIM1; k=rsa; 123456 becomes TXT v=DKIM1

Sorry for the late answer.

I can not verify the issue you describe, a TXT record with semicolons is parsed correctly for me.

Please sign in to comment.