From 9dd254c2a20b393d68c9db4b17a15a672e2a2c16 Mon Sep 17 00:00:00 2001 From: r7kamura Date: Thu, 18 Apr 2019 17:44:22 +0900 Subject: Preserve html_safe? status on ActiveSupport::SafeBuffer#* --- activesupport/lib/active_support/core_ext/string/output_safety.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activesupport/lib/active_support/core_ext') 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 -- cgit v1.2.3