Skip to content

< in script block breaks parsing in 2.1.0 #188

@gfeld

Description

@gfeld

The following example returns zero.

count((new Dom())->load('
<html>
<head>
    <script type="text/javascript">
        console.log(1 < 3);
    </script>
</head>
<body>
    <div id="panel"></div>
</body>
</html>
', ['removeScripts' => false])->find('body'));

if I comment out the following lines in Dom.php

        if (trim($tag) == '')
        {
            // no tag found, invalid < found
            return $return;
        }

everything works as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions