summaryrefslogtreecommitdiffstats
path: root/app/controllers/settings_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-21 18:07:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-21 18:07:52 +0000
commitfcd8ace743b83c83eeffb726f26b9153d633226c (patch)
treea6bde0a6edada44e8e35679fdeea39fa64a0fd58 /app/controllers/settings_controller.rb
parentfcec4d0975aef9c49cd5962441481ec258535bd5 (diff)
downloadredmine-fcd8ace743b83c83eeffb726f26b9153d633226c.tar.gz
redmine-fcd8ace743b83c83eeffb726f26b9153d633226c.zip
Don't check that params[:settings] is a Hash.
git-svn-id: http://svn.redmine.org/redmine/trunk@15729 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/settings_controller.rb')
-rw-r--r--app/controllers/settings_controller.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb
index dfbf3fc1e..fd9cd04c8 100644
--- a/app/controllers/settings_controller.rb
+++ b/app/controllers/settings_controller.rb
@@ -32,9 +32,10 @@ class SettingsController < ApplicationController
def edit
@notifiables = Redmine::Notifiable.all
- if request.post? && params[:settings] && params[:settings].is_a?(Hash)
- Setting.set_all_from_params(params[:settings])
- flash[:notice] = l(:notice_successful_update)
+ if request.post?
+ if Setting.set_all_from_params(params[:settings])
+ flash[:notice] = l(:notice_successful_update)
+ end
redirect_to settings_path(:tab => params[:tab])
else
@options = {}
@@ -60,7 +61,7 @@ class SettingsController < ApplicationController
end
if request.post?
- Setting.send "plugin_#{@plugin.id}=", params[:settings]
+ Setting.send "plugin_#{@plugin.id}=", params[:settings].permit!.to_h
flash[:notice] = l(:notice_successful_update)
redirect_to plugin_settings_path(@plugin)
else