mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #1948 from dmathieu/html_safe_numeric
All numerics should be html_safe
This commit is contained in:
@@ -67,7 +67,7 @@ class Object
|
||||
end
|
||||
end
|
||||
|
||||
class Fixnum
|
||||
class Numeric
|
||||
def html_safe?
|
||||
true
|
||||
end
|
||||
|
||||
@@ -353,6 +353,10 @@ class OutputSafetyTest < ActiveSupport::TestCase
|
||||
test "A fixnum is safe by default" do
|
||||
assert 5.html_safe?
|
||||
end
|
||||
|
||||
test "a float is safe by default" do
|
||||
assert 5.7.html_safe?
|
||||
end
|
||||
|
||||
test "An object is unsafe by default" do
|
||||
assert !@object.html_safe?
|
||||
|
||||
Reference in New Issue
Block a user