Skip to content

Commit

Permalink
Freeze string for default content for tag_strings, which later goes o…
Browse files Browse the repository at this point in the history
…n to create new content. This should also be inline with content being passed should not be mutable
  • Loading branch information
vipulnsward committed Jun 28, 2016
1 parent 13a5cc3 commit 6f4719d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/tag_helper.rb
Expand Up @@ -41,7 +41,7 @@ def tag_string(name, content = nil, escape_attributes: true, **options, &block)
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

Expand Down

0 comments on commit 6f4719d

Please sign in to comment.