]> git.openstreetmap.org Git - rails.git/commitdiff
Avoid passing the current_user.id when commenting
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 2 Aug 2017 13:58:03 +0000 (14:58 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 2 Aug 2017 13:58:03 +0000 (14:58 +0100)
Doing so doesn't appear to be necessary, and it opens up a spoofing
hole if it's actually used.

app/views/issues/_comments.html.erb

index 6c684c253b190a7c8899df9ba6fd297506b06060..6e0f241b29f1c51c20d0af06ee309f0000f62a3d 100644 (file)
@@ -20,7 +20,7 @@
 </div>
 <br/>
 <div class="comment">
 </div>
 <br/>
 <div class="comment">
-  <%= form_for :issue_comment, :url => { :action => 'comment', :id => @issue.id, :user_id => current_user.id } do |f| %>
+  <%= form_for :issue_comment, :url => { :action => 'comment', :id => @issue.id } do |f| %>
   <%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
   <%= label_tag t('issues.show.comments.reassign_param') %> <%= check_box_tag :reassign, true %>
   <br/>
   <%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
   <%= label_tag t('issues.show.comments.reassign_param') %> <%= check_box_tag :reassign, true %>
   <br/>