aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/output_safety.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string/output_safety.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb
index 9a7c520e75..3ee5bcaab4 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -1,4 +1,5 @@
-require "erb"
+require 'erb'
+require 'active_support/core_ext/object/singleton_class'
class ERB
module Util
@@ -23,12 +24,14 @@ class ERB
end
end
- undef :h
+ remove_method(:h)
alias h html_escape
- module_function :html_escape
module_function :h
+ singleton_class.send(:remove_method, :html_escape)
+ module_function :html_escape
+
# A utility method for escaping HTML entities in JSON strings.
# This method is also aliased as <tt>j</tt>.
#