mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Making escaped things more readable
This commit is contained in:
committed by
wycats
parent
3da9a08a73
commit
beeb02076a
@@ -129,7 +129,7 @@ module ActionView
|
||||
if (obj = (object.respond_to?(:errors) ? object : instance_variable_get("@#{object}"))) &&
|
||||
(errors = obj.errors[method])
|
||||
content_tag("div",
|
||||
(options[:prepend_text].html_safe << errors.first).safe_concat(options[:append_text]),
|
||||
"#{options[:prepend_text]}#{ERB::Util.h(errors.first)}#{options[:append_text]}".html_safe,
|
||||
:class => options[:css_class]
|
||||
)
|
||||
else
|
||||
|
||||
@@ -109,7 +109,7 @@ module ActionView
|
||||
|
||||
def content_tag_string(name, content, options, escape = true)
|
||||
tag_options = tag_options(options, escape) if options
|
||||
("<#{name}#{tag_options}>".html_safe << content.to_s).safe_concat("</#{name}>")
|
||||
"<#{name}#{tag_options}>#{ERB::Util.h(content)}</#{name}>".html_safe
|
||||
end
|
||||
|
||||
def tag_options(options, escape = true)
|
||||
|
||||
@@ -224,7 +224,7 @@ module ActionView
|
||||
end
|
||||
|
||||
href_attr = "href=\"#{url}\"" unless href
|
||||
("<a #{href_attr}#{tag_options}>".html_safe << (name || url)).safe_concat("</a>")
|
||||
"<a #{href_attr}#{tag_options}>#{ERB::Util.h(name || url)}</a>".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user