From 30fdee65d96924e0793ec702fcda909a2cac71ea Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 18 Oct 2019 12:34:59 -0700 Subject: [ruby/psych] Remove taint support Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. I'm not sure if the untaint calls in deduplicate are still needed after the removal of tainting in the parser. If they are not needed, they should be removed. https://github.com/ruby/psych/commit/73c1a2b4e0 --- ext/psych/lib/psych/visitors/to_ruby.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'ext/psych/lib/psych') diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb index 49447e124a..b72fb4a1dc 100644 --- a/ext/psych/lib/psych/visitors/to_ruby.rb +++ b/ext/psych/lib/psych/visitors/to_ruby.rb @@ -368,11 +368,9 @@ module Psych hash end - if String.method_defined?(:-@) + if RUBY_VERSION < '2.7' def deduplicate key if key.is_a?(String) - # It is important to untaint the string, otherwise it won't - # be deduplicated into and fstring, but simply frozen. -(key.untaint) else key @@ -381,9 +379,7 @@ module Psych else def deduplicate key if key.is_a?(String) - # Deduplication is not supported by this implementation, - # but we emulate it's side effects - key.untaint.freeze + -key else key end -- cgit v1.2.3