aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/output_safety.rb
diff options
context:
space:
mode:
authorBrian Cardarella <bcardarella@gmail.com>2011-07-29 13:06:45 -0400
committerBrian Cardarella <bcardarella@gmail.com>2011-07-29 13:10:31 -0400
commit6ef1079e0ed093e54a0e1dc9cb3b97d5e1330caf (patch)
treeb0e3f615a6d48f00065b3172d5d76430af049642 /activesupport/lib/active_support/core_ext/string/output_safety.rb
parent270fa63e9b16ae31371afa199d4de72afc41ac93 (diff)
downloadrails-6ef1079e0ed093e54a0e1dc9cb3b97d5e1330caf.tar.gz
rails-6ef1079e0ed093e54a0e1dc9cb3b97d5e1330caf.tar.bz2
rails-6ef1079e0ed093e54a0e1dc9cb3b97d5e1330caf.zip
Reset @dirty to false when slicing an instance of SafeBuffer
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string/output_safety.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb6
1 files changed, 6 insertions, 0 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 3bf4edbdef..6d6c4912bb 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -86,6 +86,12 @@ module ActiveSupport #:nodoc:
end
end
+ def[](*args)
+ new_safe_buffer = super
+ new_safe_buffer.instance_eval { @dirty = false }
+ new_safe_buffer
+ end
+
def safe_concat(value)
raise SafeConcatError if dirty?
original_concat(value)