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

Arrays of allowed elements/attributes/etc. in sanitizer not overridable in subclass (Ruby) #46

Open
GoogleCodeExporter opened this issue Mar 22, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

html5lib/sanitizer.rb hints that users can subclass HTMLSanitizer and
define their own constants for the array of allowable elements, attributes,
CSS properties, &c. But a subclass that defines its own constants for any
of these arrays doesn't override the built-in constants. I think this has
to do with the way Ruby looks up constants from methods defined in modules.
In any case, one fix is to use the Module#const_get method in place of
direct constant access where they appear in the
HTMLSanitizeModule#sanitize_token and HTMLSanitizeModule#sanitize_css methods.

Original issue reported on code.google.com by [email protected] on 20 Jun 2007 at 11:25

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant