aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb4
1 files changed, 3 insertions, 1 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 ba92afd5f4..24d0f9319f 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -150,7 +150,9 @@ module ActiveSupport #:nodoc:
else
if html_safe?
new_safe_buffer = super
- new_safe_buffer.instance_variable_set :@html_safe, true
+ unless new_safe_buffer.respond_to?(:frozen?) && new_safe_buffer.frozen?
+ new_safe_buffer.instance_variable_set :@html_safe, true
+ end
new_safe_buffer
else
to_str[*args]