diaspora/config/initializers/patch_active_support_output.rb
2012-03-21 13:50:24 -07:00

16 lines
416 B
Ruby

# this is a temp monkey patch to suppress errors in rails 3.1
# it was fixed in 3.2, but it does not look like they are going to backport
# see: https://github.com/rails/rails/issues/3927
class ERB
module Util
def html_escape(s)
s = s.to_s
if s.html_safe?
s
else
silence_warnings { s.gsub(/[&"><]/n) { |special| HTML_ESCAPE[special] }.html_safe }
end
end
end
end