Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script cleaner can break down html #28

Closed
asergiychuk opened this issue Aug 31, 2015 · 1 comment
Closed

Script cleaner can break down html #28

asergiychuk opened this issue Aug 31, 2015 · 1 comment
Labels

Comments

@asergiychuk
Copy link

If i meet something like that

    <p>.....</p>
    <script>
        some code ....
        document.write("<script src='some script'><\/script>")
        some code ....
    </script>
    <p>....</p>

cleaner remove many of html body

It can fix by chane code:

    $str = preg_replace("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is", '', $str);

to

$str = preg_replace("'<\s*script[^>]*[^/]>(.*?)<[^\/]*/\s*script\s*>'is", '', $str);
@paquettg paquettg added the bug label Aug 31, 2015
paquettg added a commit that referenced this issue Sep 8, 2015
@paquettg
Copy link
Owner

paquettg commented Sep 8, 2015

I could not duplicate the issue, I added a test in the commit above but, using the string you gave me, I am getting the correct result.

If you could provide a test case that fails and shows the issue, please create a pull request so I can fix it (or you could fix it and submit a pull request + test).

Thanks.

@paquettg paquettg closed this as completed Sep 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants