Skip to content

Commit

Permalink
Merge pull request #12 from LTD-Beget/extractCharSetFix
Browse files Browse the repository at this point in the history
fix wrong char set extract
  • Loading branch information
Voksiv authored Jul 18, 2016
2 parents c1f9ecd + e90ef5b commit cf7e3c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/LTDBeget/dns/record/RData.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,17 @@ private function extractCharSet(string $tokenName)
$ord = $this->stream->ord();
$this->stream->next();

if($ord === 0) { // if end of record
return;
if($ord === AsciiChar::NULL) { // if end of record
throw new SyntaxErrorException($this->stream);
}

if(!$escaping_open && $ord === 34) {
$this->txtExtractor($tokenName);
} else {
if($ord === AsciiChar::LINE_FEED || $ord === AsciiChar::VERTICAL_TAB || $ord === AsciiChar::NULL) {
$this->stream->previous();
throw new SyntaxErrorException($this->stream);
}
$this->tokens[$tokenName] .= chr($ord);
$escaping_open = ($ord === 92 && !$escaping_open);
goto start;
Expand Down

0 comments on commit cf7e3c6

Please sign in to comment.