aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/handlers/erb.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-05-17 19:39:38 +0400
committerwycats <wycats@gmail.com>2010-05-17 19:39:38 +0400
commit02c36cf5cb736a6c7321c8cb9a632a3a74344f25 (patch)
tree09d13f6b9fdee8ea3a796dab22d826d16206388d /actionpack/lib/action_view/template/handlers/erb.rb
parent821e15e5f2d9ef2aa43918a16cbd00f40c221e95 (diff)
downloadrails-02c36cf5cb736a6c7321c8cb9a632a3a74344f25.tar.gz
rails-02c36cf5cb736a6c7321c8cb9a632a3a74344f25.tar.bz2
rails-02c36cf5cb736a6c7321c8cb9a632a3a74344f25.zip
Make sure encoding changes don't break 1.8
Diffstat (limited to 'actionpack/lib/action_view/template/handlers/erb.rb')
-rw-r--r--actionpack/lib/action_view/template/handlers/erb.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb
index bbf012ab15..cbed0108cf 100644
--- a/actionpack/lib/action_view/template/handlers/erb.rb
+++ b/actionpack/lib/action_view/template/handlers/erb.rb
@@ -7,7 +7,7 @@ module ActionView
class OutputBuffer < ActiveSupport::SafeBuffer
def initialize(*)
super
- encode!
+ encode! if encoding_aware?
end
def <<(value)
@@ -106,6 +106,8 @@ module ActionView
if !encoding && (template.source.encoding == Encoding::BINARY)
raise WrongEncodingError.new(template_source, Encoding.default_external)
end
+ else
+ erb = template.source.dup
end
result = self.class.erb_implementation.new(