Skip to content

HtmlPolicyBuilder.allowUrlProtocols() doesn't work #5

Description

@GoogleCodeExporter
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.com on 26 Mar 2012 at 10:12

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions