apostrophecms / sanitize-html

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance
MIT License
3.68k stars 349 forks source link

Fix protocol relative url in scripts tags #531 #555

Closed paweljq closed 1 year ago

paweljq commented 1 year ago

Summary

Allow relative url in script tags. Logic is the same like in iframe tag.

What are the specific steps to test this change?

Proper test has been written to cover this situation. Test name:

Should allow protocol-relative URLs for script tag

What kind of change does this PR introduce?

(Check at least one)

Make sure the PR fulfills these requirements:

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information: