aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2018-04-27 03:20:44 +0900
committerAkira Matsuda <ronnie@dio.jp>2018-04-27 03:25:07 +0900
commit7d2400ab61c8e3ed95e14d03ba3844e8ba2e36e4 (patch)
tree66d3672fca139c25df6cf62606e2c72b6d16ce7d /actionview
parent9276ea89d2b0be9fdd1ad6590857f8d45a38c267 (diff)
downloadrails-7d2400ab61c8e3ed95e14d03ba3844e8ba2e36e4.tar.gz
rails-7d2400ab61c8e3ed95e14d03ba3844e8ba2e36e4.tar.bz2
rails-7d2400ab61c8e3ed95e14d03ba3844e8ba2e36e4.zip
Don't try to destoy the given string via method argument
Or it would raise if the argument was frozen. And even with this change, it would still reduce String allocations together with 9276ea89d2b0be9fdd1ad6590857f8d45a38c267 because `escape` should be `true` in most cases
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/tag_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb
index 42a9277564..146bd5ee24 100644
--- a/actionview/lib/action_view/helpers/tag_helper.rb
+++ b/actionview/lib/action_view/helpers/tag_helper.rb
@@ -88,7 +88,7 @@ module ActionView
if value.is_a?(Array)
value = escape ? safe_join(value, " ".freeze) : value.join(" ".freeze)
else
- value = escape ? ERB::Util.unwrapped_html_escape(value) : value.to_s
+ value = escape ? ERB::Util.unwrapped_html_escape(value) : value.to_s.dup
end
value.gsub!('"'.freeze, '&quot;'.freeze)
%(#{key}="#{value}")