From 2e8d50e7e383e31e5d97a03dfecedc982763ca3f Mon Sep 17 00:00:00 2001 From: aurelie-vndl Date: Wed, 29 Mar 2023 14:32:14 +0200 Subject: [PATCH] Fix parsing html with tag that has 'tag' attribute, see https://github.com/paquettg/php-html-parser/pull/311 --- src/PHPHtmlParser/Dom/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PHPHtmlParser/Dom/Parser.php b/src/PHPHtmlParser/Dom/Parser.php index 7ed310cb..e8e54a0b 100644 --- a/src/PHPHtmlParser/Dom/Parser.php +++ b/src/PHPHtmlParser/Dom/Parser.php @@ -37,7 +37,7 @@ public function parse(Options $options, Content $content, int $size): AbstractNo $root->setHtmlSpecialCharsDecode($options->isHtmlSpecialCharsDecode()); $activeNode = $root; while ($activeNode !== null) { - if ($activeNode && $activeNode->tag->name() === 'script' + if ($activeNode && $activeNode->getTag()->name() === 'script' && $options->isCleanupInput() !== true ) { $str = $content->copyUntil('