From: Go MAEDA Date: Wed, 9 Feb 2022 01:20:00 +0000 (+0000) Subject: Merged r21294 from trunk to 4.1-stable (#36226). X-Git-Tag: 4.1.6~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=50e9988a60677f6a2cb6d424fb454e0551412a0c;p=redmine.git Merged r21294 from trunk to 4.1-stable (#36226). git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@21406 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/setting.rb b/app/models/setting.rb index 384bb900b..763f83f62 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -100,7 +100,8 @@ class Setting < ActiveRecord::Base v = read_attribute(:value) # Unserialize serialized settings if available_settings[name]['serialized'] && v.is_a?(String) - v = YAML::load(v) + # YAML.load works as YAML.safe_load if Psych >= 4.0 is installed + v = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(v) : YAML.load(v) v = force_utf8_strings(v) end v = v.to_sym if available_settings[name]['format'] == 'symbol' && !v.blank?