summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/HTML5/Parser/Tokenizer.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/HTML5/Parser/Tokenizer.php b/src/HTML5/Parser/Tokenizer.php
index a41fcb4..f4e9652 100644
--- a/src/HTML5/Parser/Tokenizer.php
+++ b/src/HTML5/Parser/Tokenizer.php
@@ -163,15 +163,21 @@ class Tokenizer
break;
default:
- if ('<' !== $tok && '&' !== $tok) {
- // NULL character
- if ("\00" === $tok) {
- $this->parseError('Received null character.');
- }
+ if ('<' === $tok || '&' === $tok) {
+ break;
+ }
+
+ // NULL character
+ if ("\00" === $tok) {
+ $this->parseError('Received null character.');
$this->text .= $tok;
$this->scanner->consume();
+
+ break;
}
+
+ $this->text .= $this->scanner->charsUntil("<&\0");
}
}