Clean tag attributes before passing through the escape_once logic.

Addresses CVE-2009-3009
This commit is contained in:
Michael Koziarski 2009-08-31 12:07:30 -07:00
parent e31d29fae7
commit 5b8b41732f
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ module ActionView
# escape_once("<< Accept & Checkout")
# # => "<< Accept & Checkout"
def escape_once(html)
html.to_s.gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
ActiveSupport::Multibyte.clean(html.to_s).gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
end
private