]> source.dussan.org Git - redmine.git/commitdiff
Merged r21294 from trunk to 4.1-stable (#36226).
authorGo MAEDA <maeda@farend.jp>
Wed, 9 Feb 2022 01:20:00 +0000 (01:20 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 9 Feb 2022 01:20:00 +0000 (01:20 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@21406 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/setting.rb

index 384bb900b3f89b33bbcaf92367ea72e555d64fbd..763f83f620ee2d86d02b86d6dd876a04c5942495 100644 (file)
@@ -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?