diff options
author | Brian Cardarella <bcardarella@gmail.com> | 2011-07-29 13:06:45 -0400 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:24 -0700 |
commit | 9d5340e7094444a35c48035d9f111617806d519c (patch) | |
tree | 9476444d77d09587cff9ce7fb150368b788a7ecc /activesupport/lib | |
parent | 1deb0253aee8ea96eaa118dba7cf8eaa42dcbeba (diff) | |
download | rails-9d5340e7094444a35c48035d9f111617806d519c.tar.gz rails-9d5340e7094444a35c48035d9f111617806d519c.tar.bz2 rails-9d5340e7094444a35c48035d9f111617806d519c.zip |
Reset @dirty to false when slicing an instance of SafeBuffer
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 6 |
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) |