aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/uri.rb17
1 files changed, 7 insertions, 10 deletions
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
-