aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-06-10 18:22:42 -0400
committerPrem Sichanugrist <s@sikachu.com>2011-06-10 18:51:48 -0400
commit115e80dccc65c3ed9a9750649d9ca4ea2a7e64f1 (patch)
treeed8e49d65afd73d5dd338cb62efbb9dedf70c9bc /actionpack/lib/action_view
parent37577988561e97e7ea154a7f90bfd8fe3db9426d (diff)
downloadrails-115e80dccc65c3ed9a9750649d9ca4ea2a7e64f1.tar.gz
rails-115e80dccc65c3ed9a9750649d9ca4ea2a7e64f1.tar.bz2
rails-115e80dccc65c3ed9a9750649d9ca4ea2a7e64f1.zip
Make sure that we don't perform in-place mutation on SafeBuffer string
This will make sure `render :inline` is working. Closes #1633
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/template.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 10797c010f..9c59d18310 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -218,6 +218,9 @@ module ActionView
method_name = self.method_name
if source.encoding_aware?
+ # Avoid performing in-place mutation for SafeBuffer
+ @source = source.to_str if source.html_safe?
+
# Look for # encoding: *. If we find one, we'll encode the
# String in that encoding, otherwise, we'll use the
# default external encoding.