1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Explicit html_escape removed when not needed

Signed-off-by: Yehuda Katz <yehudakatz@YK.local>
This commit is contained in:
Santiago Pastorino and José Ignacio Costa 2010-02-14 01:46:02 -02:00 committed by Yehuda Katz
parent 9f1900ec7a
commit 98a5bf8ff2
3 changed files with 4 additions and 4 deletions

View file

@ -127,7 +127,7 @@ module ActionView
if (obj = (object.respond_to?(:errors) ? object : instance_variable_get("@#{object}"))) && if (obj = (object.respond_to?(:errors) ? object : instance_variable_get("@#{object}"))) &&
(errors = obj.errors[method]) (errors = obj.errors[method])
content_tag("div", content_tag("div",
"#{options[:prepend_text]}#{ERB::Util.html_escape(errors.first)}#{options[:append_text]}".html_safe, (options[:prepend_text].html_safe << errors.first).safe_concat(options[:append_text]),
:class => options[:css_class] :class => options[:css_class]
) )
else else
@ -226,7 +226,7 @@ module ActionView
error_messages = objects.sum do |object| error_messages = objects.sum do |object|
object.errors.full_messages.map do |msg| object.errors.full_messages.map do |msg|
content_tag(:li, ERB::Util.html_escape(msg)) content_tag(:li, msg)
end end
end.join.html_safe end.join.html_safe

View file

@ -127,7 +127,7 @@ module ActionView
def content_tag_string(name, content, options, escape = true) def content_tag_string(name, content, options, escape = true)
tag_options = tag_options(options, escape) if options tag_options = tag_options(options, escape) if options
"<#{name}#{tag_options}>#{ERB::Util.h content}</#{name}>".html_safe ("<#{name}#{tag_options}>".html_safe << content.to_s).safe_concat("</#{name}>")
end end
def tag_options(options, escape = true) def tag_options(options, escape = true)

View file

@ -226,7 +226,7 @@ module ActionView
end end
href_attr = "href=\"#{url}\"" unless href href_attr = "href=\"#{url}\"" unless href
"<a #{href_attr}#{tag_options}>#{ERB::Util.h(name || url)}</a>".html_safe ("<a #{href_attr}#{tag_options}>".html_safe << (name || url)).safe_concat("</a>")
end end
end end