summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-07-20 04:14:03 +0000
committerGo MAEDA <maeda@farend.jp>2022-07-20 04:14:03 +0000
commitc68090dae7760171da143eba59630cdc676e3f8a (patch)
tree5dcb25cad1a0a095bf5ea2b66464ad3d2a7f250e /app/models
parent593922581347b897d552783ba0b79e59b7f90261 (diff)
downloadredmine-c68090dae7760171da143eba59630cdc676e3f8a.tar.gz
redmine-c68090dae7760171da143eba59630cdc676e3f8a.zip
Merged r21722 from trunk to 5.0-stable (#37450).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21723 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-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 a7b763503..53b88bcad 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -108,8 +108,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?