summaryrefslogtreecommitdiffstats
path: root/app/controllers/attachments_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-03 08:30:32 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-03 08:30:32 +0000
commit8e2983dd70e4f13e304dc3dccbad0960f18879a1 (patch)
tree8a7a53969c9b9e12106027a27570dffa02cd45e9 /app/controllers/attachments_controller.rb
parent99a714e39bd47fff8f02629965fea17948c37217 (diff)
downloadredmine-8e2983dd70e4f13e304dc3dccbad0960f18879a1.tar.gz
redmine-8e2983dd70e4f13e304dc3dccbad0960f18879a1.zip
Don't check that param is a Hash.
git-svn-id: http://svn.redmine.org/redmine/trunk@16601 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/attachments_controller.rb')
-rw-r--r--app/controllers/attachments_controller.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 1c79ff4b3..8f3fcd82e 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -114,11 +114,9 @@ class AttachmentsController < ApplicationController
# Update all the attachments of a container
def update_all
- if params[:attachments].is_a?(Hash)
- if Attachment.update_attachments(@attachments, params[:attachments])
- redirect_back_or_default home_path
- return
- end
+ if Attachment.update_attachments(@attachments, update_all_params)
+ redirect_back_or_default home_path
+ return
end
render :action => 'edit_all'
end
@@ -225,4 +223,9 @@ class AttachmentsController < ApplicationController
'attachment'
end
end
+
+ # Returns attachments param for #update_all
+ def update_all_params
+ params.permit(:attachments => [:filename, :description]).require(:attachments)
+ end
end