aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorYasuo Honda <yasuo.honda@gmail.com>2018-03-22 11:46:20 +0000
committerYasuo Honda <yasuo.honda@gmail.com>2018-03-22 11:48:58 +0000
commitb40a729698c0cb15b1aea3d13115e438d8e8b88e (patch)
tree6e21a3a1eb8bc5785640bc06cb2448c3597ddb2f /activesupport
parent4c9c3ffc2e80155f31dbcf80591618ed1c858685 (diff)
downloadrails-b40a729698c0cb15b1aea3d13115e438d8e8b88e.tar.gz
rails-b40a729698c0cb15b1aea3d13115e438d8e8b88e.tar.bz2
rails-b40a729698c0cb15b1aea3d13115e438d8e8b88e.zip
Ruby 2.6 will not require monkey patched `URI#unescape`
since revision 62897 https://github.com/ruby/ruby/commit/234a30459cdae6aa7da6e28a1082d9c11f315696
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/uri.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/core_ext/uri.rb b/activesupport/lib/active_support/core_ext/uri.rb
index dadabb02e5..02eb3e14d9 100644
--- a/activesupport/lib/active_support/core_ext/uri.rb
+++ b/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