diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-19 07:04:13 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-19 07:04:13 +0900 |
commit | 4acddae05e65ec62114219d0595d78bd13ed889d (patch) | |
tree | 3c282de1ea3b7c058c43faf44f36bb4ac7a58b57 /activesupport/lib | |
parent | 8ac4d1500505f15ba3630ba1e88d395ad43442a5 (diff) | |
parent | 9dd254c2a20b393d68c9db4b17a15a672e2a2c16 (diff) | |
download | rails-4acddae05e65ec62114219d0595d78bd13ed889d.tar.gz rails-4acddae05e65ec62114219d0595d78bd13ed889d.tar.bz2 rails-4acddae05e65ec62114219d0595d78bd13ed889d.zip |
Merge pull request #36012 from r7kamura/feature/safe-buffer-multiplication
Preserve html_safe? status on ActiveSupport::SafeBuffer#*
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index 638152626b..645b1fea17 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -213,6 +213,12 @@ module ActiveSupport #:nodoc: dup.concat(other) end + def *(*) + new_safe_buffer = super + new_safe_buffer.instance_variable_set(:@html_safe, @html_safe) + new_safe_buffer + end + def %(args) case args when Hash |