diff options
author | Go MAEDA <maeda@farend.jp> | 2022-02-09 00:53:35 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-02-09 00:53:35 +0000 |
commit | 7dff6698f8733655cf8a765c41a517bb1a9c81c2 (patch) | |
tree | f6e7f6a62d3520e30d05f5abd573e6379d6bfafb /app | |
parent | 74d0594c2e4785f18894a35273a437eb6e7c5685 (diff) | |
download | redmine-7dff6698f8733655cf8a765c41a517bb1a9c81c2.tar.gz redmine-7dff6698f8733655cf8a765c41a517bb1a9c81c2.zip |
Merged r21294 from trunk to 4.2-stable (#36226).
git-svn-id: http://svn.redmine.org/redmine/branches/4.2-stable@21404 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/setting.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb index 5e5685b37..45a3827ec 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -105,7 +105,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? |