Permalink
Browse files

URI.unescape fix removes the old unescape method

  • Loading branch information...
1 parent a8f32e1 commit 99341a2d80a3ff516ae1e5f217340c6adec2b39b @jeremy jeremy committed Feb 21, 2009
Showing with 7 additions and 10 deletions.
  1. +7 −10 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
-

0 comments on commit 99341a2

Please sign in to comment.