Permalink
Browse files

Ruby 2.6 will not require monkey patched `URI#unescape`

since revision 62897 ruby/ruby@234a304
  • Loading branch information...
yahonda committed Mar 22, 2018
1 parent 4c9c3ff commit b40a729698c0cb15b1aea3d13115e438d8e8b88e
Showing with 1 addition and 9 deletions.
  1. +1 −9 activesupport/lib/active_support/core_ext/uri.rb
@@ -2,16 +2,8 @@
require "uri"
str = "\xE6\x97\xA5"
parser = URI::Parser.new
needs_monkeypatch =
begin
str + str != parser.unescape(str + parser.escape(str).force_encoding(Encoding::UTF_8))
rescue Encoding::CompatibilityError
true
end
if needs_monkeypatch
if RUBY_VERSION < "2.6.0"
require "active_support/core_ext/module/redefine_method"
URI::Parser.class_eval do
silence_redefinition_of_method :unescape

0 comments on commit b40a729

Please sign in to comment.