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

Negative values inside of css properties. #64

Closed
ghost opened this issue Mar 15, 2014 · 3 comments
Closed

Negative values inside of css properties. #64

ghost opened this issue Mar 15, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 15, 2014

I'm trying to sanitize property with negative value, but it removes the property,
i've attached the failing test

class IntegrationTestCssNegative < Loofah::TestCase
    def test_css_negative_value_sanitization
        html = "<span style=\"word-spacing: -1px;\"></span>"
        sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :escape).to_xml)
        assert_match %r/-1px/,    sane.inner_html
    end
end
@flavorjones
Copy link
Owner

I believed this was fixed on master (see ca618fc) but this test case fails. Will try to figure it out today.

@flavorjones
Copy link
Owner

Ah - OK. The general problem of negative values is solved on master (and I added your mostly-unmodified test case to make sure). But the word-spacing property isn't whitelisted.

I've opened #68 for the whitelist problem. And so I'm closing this issue.

Thanks!

@ghost
Copy link
Author

ghost commented Apr 24, 2014

Got it, Thanks Mike!

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

No branches or pull requests

1 participant