diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-02-20 18:25:02 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-02-20 18:25:02 -0800 |
commit | 98ddc6478252c2a2e24f2169125f2b3f53dd7b36 (patch) | |
tree | 4aa65c068da381ad49571ed2f118c90e75dc6f52 /activesupport/lib | |
parent | 3b3dbd797397fe692fa50bdb46a0db06b82bf848 (diff) | |
download | rails-98ddc6478252c2a2e24f2169125f2b3f53dd7b36.tar.gz rails-98ddc6478252c2a2e24f2169125f2b3f53dd7b36.tar.bz2 rails-98ddc6478252c2a2e24f2169125f2b3f53dd7b36.zip |
URI.unescape fix removes the old unescape method
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/uri.rb | 17 |
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 - |