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

html with <script> always invalid even when script tag added to whitelist #299

Closed
hferentschik opened this issue Feb 18, 2013 · 4 comments · Fixed by #388
Closed

html with <script> always invalid even when script tag added to whitelist #299

hferentschik opened this issue Feb 18, 2013 · 4 comments · Fixed by #388
Assignees
Milestone

Comments

@hferentschik
Copy link

With JSoup 1.6.3 I used to be able to do

...
whitelist.addTags( "script" );
Jsoup.isValid( "Hello<span>foo</span>World !", whitelist )

...

This would return true. Without adding the tag false. With JSoup 1.7.2 is would always be false. Is that expected?

@jhy
Copy link
Owner

jhy commented Feb 18, 2013

Can you provide a full code sample?

@hferentschik
Copy link
Author

Using a TestNG unit test:

@Test
public void testJSoupIsValid() {
    Whitelist whitelist = Whitelist.relaxed();
    whitelist.addTags( "script" );
    assertTrue( Jsoup.isValid( "Hello<script>alert('Doh')</script>World !", whitelist ) );
}

Actually passes with JSoup 1.7.1, but fails with 1.7.2.

@ghost ghost assigned jhy Feb 19, 2013
@hferentschik
Copy link
Author

Hi, just wondering whether this is supposed to be resolved in 1.7.3? It is assigned to the 1.7.3 milestone, but afaict it is still not working in 1.7.3?

@hferentschik
Copy link
Author

thanks :-)

zazi pushed a commit to dswarm/jsoup that referenced this issue Oct 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants