Actions
Defect #36226
closedPsych 4: Psych::DisallowedClass exception when unserializing a setting value
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
Psych 4.0 uses safe_load by default (see https://github.com/ruby/psych/pull/487). Due to this change, Setting#value may raise Psych::DisallowedClass exception.
$ echo gem "'psych', '~> 4.0.0'" >> Gemfile.local
$ bundle install
$ bin/rails test test/functional/settings_controller_test.rb
Run options: --seed 45283
# Running:
...................E
Error:
SettingsControllerTest#test_post_plugin_settings:
Psych::DisallowedClass: Tried to load unspecified class: ActiveSupport::HashWithIndifferentAccess
app/models/setting.rb:109:in `value'
app/models/setting.rb:131:in `[]='
app/models/setting.rb:326:in `plugin_foo='
app/controllers/settings_controller.rb:73:in `plugin'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
test/functional/settings_controller_test.rb:244:in `test_post_plugin_settings'
rails test test/functional/settings_controller_test.rb:237
Related issues
Actions