diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-03-22 17:39:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 17:39:35 -0400 |
commit | e0783cc9f12fe3b74b45a61b551d0cd93748e211 (patch) | |
tree | 6e21a3a1eb8bc5785640bc06cb2448c3597ddb2f /activesupport/lib | |
parent | 4c9c3ffc2e80155f31dbcf80591618ed1c858685 (diff) | |
parent | b40a729698c0cb15b1aea3d13115e438d8e8b88e (diff) | |
download | rails-e0783cc9f12fe3b74b45a61b551d0cd93748e211.tar.gz rails-e0783cc9f12fe3b74b45a61b551d0cd93748e211.tar.bz2 rails-e0783cc9f12fe3b74b45a61b551d0cd93748e211.zip |
Merge pull request #32319 from yahonda/no_monkeypatch_for_ruby260
Ruby 2.6 will not require monkey patched `URI#unescape`
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/uri.rb | 10 |
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 |