diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index c35a359730..9ba49207c1 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,7 @@ +* Fix `ActiveSupport::EncryptedConfiguration` to be compatible with Psych 4 + + *Stephen Sugden* + * Improve `File.atomic_write` error handling * Fix `Class#descendants` and `DescendantsTracker#descendants` compatibility with Ruby 3.1. diff --git a/activesupport/lib/active_support/encrypted_configuration.rb b/activesupport/lib/active_support/encrypted_configuration.rb index fd8ab6c7c3..3382fe7508 100644 --- a/activesupport/lib/active_support/encrypted_configuration.rb +++ b/activesupport/lib/active_support/encrypted_configuration.rb @@ -49,7 +49,8 @@ module ActiveSupport end def deserialize(config) - YAML.load(config).presence || {} + doc = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(config) : YAML.load(config) + doc.presence || {} end end end