From 98ddc6478252c2a2e24f2169125f2b3f53dd7b36 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 20 Feb 2009 18:25:02 -0800 Subject: URI.unescape fix removes the old unescape method --- activesupport/lib/active_support/core_ext/uri.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/uri.rb b/activesupport/lib/active_support/core_ext/uri.rb index 26b050bf2b..4c8ebbee58 100644 --- a/activesupport/lib/active_support/core_ext/uri.rb +++ b/activesupport/lib/active_support/core_ext/uri.rb @@ -1,13 +1,10 @@ -require 'uri' - -module ActiveSupport - if RUBY_VERSION == "1.9.1" && defined?(RUBY_PATCHLEVEL) && RUBY_PATCHLEVEL == 0 - ::URI::Parser.class_eval do - def unescape(str, escaped = @regexp[:ESCAPED]) - enc = (str.encoding == Encoding::US_ASCII) ? Encoding::UTF_8 : str.encoding - str.gsub(escaped) { [$&[1, 2].hex].pack('C') }.force_encoding(enc) - end +if RUBY_VERSION == "1.9.1" && defined?(RUBY_PATCHLEVEL) && RUBY_PATCHLEVEL == 0 + require 'uri' + URI::Parser.class_eval do + remove_method :unescape + def unescape(str, escaped = @regexp[:ESCAPED]) + enc = (str.encoding == Encoding::US_ASCII) ? Encoding::UTF_8 : str.encoding + str.gsub(escaped) { [$&[1, 2].hex].pack('C') }.force_encoding(enc) end end end - -- cgit v1.2.3