diff options
author | Christopher Meiklejohn <christopher.meiklejohn@gmail.com> | 2011-06-20 13:47:22 -0400 |
---|---|---|
committer | Christopher Meiklejohn <christopher.meiklejohn@gmail.com> | 2011-06-20 13:52:21 -0400 |
commit | a52e4189b5e9fe6ef58106302aeb7cfef8804c4a (patch) | |
tree | 08cb0428d5dbba16376c3f83e6400a29b59b5372 /actionpack/lib | |
parent | d12aa483f23fd32cd3f27be07ff259ee14424d3f (diff) | |
download | rails-a52e4189b5e9fe6ef58106302aeb7cfef8804c4a.tar.gz rails-a52e4189b5e9fe6ef58106302aeb7cfef8804c4a.tar.bz2 rails-a52e4189b5e9fe6ef58106302aeb7cfef8804c4a.zip |
Only mark the sliced buffer as safe, if it was safe to begin with.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/cache_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index ce73f1d4f7..f81ce3e31c 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -51,8 +51,9 @@ module ActionView # This dance is needed because Builder can't use capture pos = output_buffer.length yield + output_safe = output_buffer.html_safe? fragment = output_buffer.slice!(pos..-1) - if output_buffer.kind_of?(ActiveSupport::SafeBuffer) + if output_safe self.output_buffer = output_buffer.html_safe end controller.write_fragment(name, fragment, options) |