aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-12-29 12:50:09 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-12-29 12:50:09 -0300
commit724707edfdedc63672284be2887484e8b65da02e (patch)
tree9dc977bf61224ffcaf93a714971c877b72482c9d /activesupport/lib/active_support
parentb67b57d47368b4b834cfe8c58d9e26f5c819c154 (diff)
parent983674667a21ee2e4e6a43282507858634dce907 (diff)
downloadrails-724707edfdedc63672284be2887484e8b65da02e.tar.gz
rails-724707edfdedc63672284be2887484e8b65da02e.tar.bz2
rails-724707edfdedc63672284be2887484e8b65da02e.zip
Merge pull request #18236 from vipulnsward/dont-eval-frozen
Fix html_safe string access modifying frozen values
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]