diff options
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 9 |
1 files changed, 1 insertions, 8 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 55579ec259..1371abbc4a 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -287,14 +287,7 @@ module ActiveSupport #:nodoc: end def set_block_back_references(block, match_data) - Thread.current[:__active_support_safe_buffer_backref] = match_data - begin - block.binding.eval(<<-EOC) - $~ = Thread.current[:__active_support_safe_buffer_backref] - EOC - ensure - Thread.current[:__active_support_safe_buffer_backref] = nil - end + block.binding.eval("proc { |m| $~ = m }").call(match_data) end end end |