If I specify a custom set of allowed URL protocols different from the set
"http", "https" and "mailto", some URLs are not handled correctly.
E.g. for the input "<img src=\"http://canaries.org/canary.png\">" the policy
builder
new HtmlPolicyBuilder()
.allowElements("img")
.allowAttributes("src").onElements("img")
.allowUrlProtocols("http")
returns an empty string, but should return the unmodified input value.
I have attached a patch containing an additional test case that shows the issue
and a fix for it in the class FilterUrlByProtocolAttributePolicy.
Original issue reported on code.google.com by
stefan.e...@gmail.comon 26 Mar 2012 at 10:12Attachments: