Fix mass assignment vuln in comment update action (#2704).
Prevents mass assignment of `post_id`, `do_not_bump_post`, and `is_deleted`.
This commit is contained in:
@@ -23,7 +23,7 @@ class CommentsController < ApplicationController
|
||||
def update
|
||||
@comment = Comment.find(params[:id])
|
||||
check_privilege(@comment)
|
||||
@comment.update_attributes(params[:comment])
|
||||
@comment.update_attributes(params[:comment].permit(:body))
|
||||
respond_with(@comment, :location => post_path(@comment.post_id))
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user