Final fix for #2658 - close exploit with "new".

This commit is contained in:
Type-kun
2017-01-16 19:34:31 +05:00
parent 15b711e423
commit 6a6d16852a

View File

@@ -10,6 +10,10 @@ class ForumPostsController < ApplicationController
@forum_topic = ForumTopic.find(params[:topic_id])
raise User::PrivilegeError.new unless @forum_topic.visible?(CurrentUser.user)
end
if params[:post_id]
quoted_post = ForumPost.find(params[:post_id])
raise User::PrivilegeError.new unless quoted_post.topic.visible?(CurrentUser.user)
end
@forum_post = ForumPost.new_reply(params)
respond_with(@forum_post)
end