From d1a9db6257552f4315b27574a1d733f2b4421aa4 Mon Sep 17 00:00:00 2001 From: sakarikl Date: Wed, 11 Jan 2023 14:41:45 +0200 Subject: [PATCH] $tok might be false in Tokenizer.php ctype_alpha(false) triggers warning ctype_alpha(): Argument of type bool will be interpreted as string in the future --- src/HTML5/Parser/Tokenizer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/HTML5/Parser/Tokenizer.php b/src/HTML5/Parser/Tokenizer.php index 016919a..f436f91 100644 --- a/src/HTML5/Parser/Tokenizer.php +++ b/src/HTML5/Parser/Tokenizer.php @@ -131,7 +131,10 @@ protected function consumeData() $tok = $this->scanner->next(); - if ('!' === $tok) { + if (false === $tok) { + // end of string + $this->parseError('Illegal tag opening'); + } elseif ('!' === $tok) { $this->markupDeclaration(); } elseif ('/' === $tok) { $this->endTag();