[ruby/erb] Keep ERB::Util#html_escape private
ERB::Util.html_escape has been public, but ERB::Util#html_escape had been private. https://github.com/ruby/erb/commit/e62210bf56
This commit is contained in:
parent
58dc9c931b
commit
addb1cbbfd
@ -88,7 +88,7 @@ Init_escape(void)
|
||||
{
|
||||
rb_cERB = rb_define_class("ERB", rb_cObject);
|
||||
rb_mUtil = rb_define_module_under(rb_cERB, "Util");
|
||||
rb_define_method(rb_mUtil, "html_escape", erb_escape_html, 1);
|
||||
rb_define_module_function(rb_mUtil, "html_escape", erb_escape_html, 1);
|
||||
|
||||
rb_cCGI = rb_define_class("CGI", rb_cObject);
|
||||
id_escapeHTML = rb_intern("escapeHTML");
|
||||
|
@ -21,14 +21,14 @@ module ERB::Util
|
||||
#
|
||||
# is a > 0 & a < 10?
|
||||
#
|
||||
unless method_defined?(:html_escape) # for JRuby
|
||||
unless defined?(ERB::Util.html_escape) # for JRuby
|
||||
def html_escape(s)
|
||||
CGI.escapeHTML(s.to_s)
|
||||
end
|
||||
module_function :html_escape
|
||||
end
|
||||
alias h html_escape
|
||||
module_function :h
|
||||
module_function :html_escape
|
||||
|
||||
#
|
||||
# A utility method for encoding the String _s_ as a URL.
|
||||
|
Loading…
x
Reference in New Issue
Block a user