summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-07-20 04:43:09 +0000
committerGo MAEDA <maeda@farend.jp>2022-07-20 04:43:09 +0000
commit562122d82e886cf23e6aef3bf3f51c51d370ad9a (patch)
tree3691f8536f11b500c9d3d689a3f6c86c876fda11 /app
parentc5fc9398d5bac0db434f03d411e6e73e4915c837 (diff)
downloadredmine-562122d82e886cf23e6aef3bf3f51c51d370ad9a.tar.gz
redmine-562122d82e886cf23e6aef3bf3f51c51d370ad9a.zip
Merged r21722 from trunk to 4.2-stable (#37450).
git-svn-id: https://svn.redmine.org/redmine/branches/4.2-stable@21724 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/setting.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb
index 45a3827ec..1418cf04b 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -105,8 +105,7 @@ class Setting < ActiveRecord::Base
v = read_attribute(:value)
# Unserialize serialized settings
if available_settings[name]['serialized'] && v.is_a?(String)
- # 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 = YAML.safe_load(v, permitted_classes: [ActiveSupport::HashWithIndifferentAccess])
v = force_utf8_strings(v)
end
v = v.to_sym if available_settings[name]['format'] == 'symbol' && !v.blank?