Floats not html_safe? #1935

Closed
tekwiz opened this Issue Jul 2, 2011 · 3 comments

Comments

Projects
None yet
3 participants

tekwiz commented Jul 2, 2011

I noticed that only Integers are considered html_safe; shouldn't floats be considered html_safe as well?

Contributor

dmathieu commented Jul 3, 2011

All numeric classes actually :)

josevalim closed this in b732724 Jul 3, 2011

tekwiz commented Jul 3, 2011

Are we sure all numerics should be safe? Not being a mathematician, this may be an ignorant assertion, but I could see some subclasses of Numeric (probably custom subclasses) having unsafe characters such as the exponential symbol, the power-of-10 symbol, or the Unicode times symbol.

Contributor

dmathieu commented Jul 3, 2011

Numeric has 4 native child classes : Bignum, Float, Fixnum, Integer.
All of these should be html_safe. For any other specific one, the method can be overriden.

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