Skip to content

Commit 23d53b1

Browse files
mr-chetanvladshut
andcommitted
Use getTag() method for tag access in Parser
Replaces direct tag property access with getTag() method in the Parser class to improve encapsulation and consistency when checking for 'script' tags. https: //github.com/paquettg/pull/311 Co-Authored-By: Vladyslav Shut <[email protected]>
1 parent 2abf8f4 commit 23d53b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PHPHtmlParser/Dom/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function parse(Options $options, Content $content, int $size): AbstractNo
4545
$activeNode = $root;
4646
while ($activeNode !== null) {
4747
if (
48-
$activeNode && is_object($activeNode->tag) && $activeNode->tag->name() === 'script'
48+
$activeNode && is_object($activeNode->tag) && $activeNode->getTag()->name() === 'script'
4949
&& $options->isCleanupInput() !== true
5050
) {
5151
$str = $content->copyUntil('</');

0 commit comments

Comments
 (0)