aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-12 21:04:02 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-02-01 08:55:18 -0200
commit608eddc6f5465c642bd02f5523a8e486a87020b1 (patch)
tree0f380e43d5db671ecb0bd58248d90452cf411a3d /actionpack/lib
parent0eb46736978eea4f37f64270d1185a1228198b6c (diff)
downloadrails-608eddc6f5465c642bd02f5523a8e486a87020b1.tar.gz
rails-608eddc6f5465c642bd02f5523a8e486a87020b1.tar.bz2
rails-608eddc6f5465c642bd02f5523a8e486a87020b1.zip
Move escape_once logic to ERB::Util, where it belongs to
All the logic is based on the HTML_ESCAPE constant available in ERB::Util, so it seems more logic to have the entire method there and just delegate the helper to use it.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index d7a2651bad..ecd26891d6 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -118,7 +118,7 @@ module ActionView
# escape_once("&lt;&lt; Accept & Checkout")
# # => "&lt;&lt; Accept &amp; Checkout"
def escape_once(html)
- html.to_s.gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
+ ERB::Util.html_escape_once(html)
end
private