mirror of https://github.com/rails/rails
Clean tag attributes before passing through the escape_once logic.
Addresses CVE-2009-3009
This commit is contained in:
parent
e31d29fae7
commit
5b8b41732f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue