aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-12-29 12:56:01 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-12-29 12:56:01 -0300
commit54ec0cbf8276c63215fcb4507581003bbcd1a48d (patch)
tree514bccd4729e0d76fcb8fc9f7277ea8cda8a2152 /activesupport/lib/active_support
parent724707edfdedc63672284be2887484e8b65da02e (diff)
downloadrails-54ec0cbf8276c63215fcb4507581003bbcd1a48d.tar.gz
rails-54ec0cbf8276c63215fcb4507581003bbcd1a48d.tar.bz2
rails-54ec0cbf8276c63215fcb4507581003bbcd1a48d.zip
Just check if the buffer exists before changing it
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 24d0f9319f..231eaedbba 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -150,9 +150,11 @@ module ActiveSupport #:nodoc:
else
if html_safe?
new_safe_buffer = super
- unless new_safe_buffer.respond_to?(:frozen?) && new_safe_buffer.frozen?
+
+ if new_safe_buffer
new_safe_buffer.instance_variable_set :@html_safe, true
end
+
new_safe_buffer
else
to_str[*args]