aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index f222e43adc..963f494760 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -94,7 +94,7 @@ module ActionView
# escape_once("<< Accept & Checkout")
# # => "<< Accept & Checkout"
def escape_once(html)
- fix_double_escape(html_escape(html.to_s))
+ html.to_s.gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
end
private
@@ -116,11 +116,6 @@ module ActionView
end
end
- # Fix double-escaped entities, such as &amp;amp;, &amp;#123;, etc.
- def fix_double_escape(escaped)
- escaped.gsub(/&amp;([a-z]+|(#\d+));/i) { "&#{$1};" }
- end
-
def block_is_within_action_view?(block)
eval("defined? _erbout", block.binding)
end