##// END OF EJS Templates
Don't check that params[:settings] is a Hash....
Jean-Philippe Lang -
r15347:fcd8ace743b8
parent child
Show More
@@ -32,9 +32,10 class SettingsController < ApplicationController
32
32
33 def edit
33 def edit
34 @notifiables = Redmine::Notifiable.all
34 @notifiables = Redmine::Notifiable.all
35 if request.post? && params[:settings] && params[:settings].is_a?(Hash)
35 if request.post?
36 Setting.set_all_from_params(params[:settings])
36 if Setting.set_all_from_params(params[:settings])
37 flash[:notice] = l(:notice_successful_update)
37 flash[:notice] = l(:notice_successful_update)
38 end
38 redirect_to settings_path(:tab => params[:tab])
39 redirect_to settings_path(:tab => params[:tab])
39 else
40 else
40 @options = {}
41 @options = {}
@@ -60,7 +61,7 class SettingsController < ApplicationController
60 end
61 end
61
62
62 if request.post?
63 if request.post?
63 Setting.send "plugin_#{@plugin.id}=", params[:settings]
64 Setting.send "plugin_#{@plugin.id}=", params[:settings].permit!.to_h
64 flash[:notice] = l(:notice_successful_update)
65 flash[:notice] = l(:notice_successful_update)
65 redirect_to plugin_settings_path(@plugin)
66 redirect_to plugin_settings_path(@plugin)
66 else
67 else
General Comments 0
You need to be logged in to leave comments. Login now