From 6f4719d91a000d7054862796b79a51f8fc548f1a Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Tue, 28 Jun 2016 02:48:23 -0700 Subject: Freeze string for default content for tag_strings, which later goes on to create new content. This should also be inline with content being passed should not be mutable --- actionview/lib/action_view/helpers/tag_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib/action_view/helpers') diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb index 09923be568..57bfa01568 100644 --- a/actionview/lib/action_view/helpers/tag_helper.rb +++ b/actionview/lib/action_view/helpers/tag_helper.rb @@ -41,7 +41,7 @@ module ActionView if VOID_ELEMENTS.include?(name) && content.nil? "<#{name.to_s.dasherize}#{tag_options(options, escape_attributes)}>".html_safe else - content_tag_string(name.to_s.dasherize, content || '', options, escape_attributes) + content_tag_string(name.to_s.dasherize, content || ''.freeze, options, escape_attributes) end end -- cgit v1.2.3