diff --git a/app/enterprise/controller/Posts.php b/app/enterprise/controller/Posts.php index 1801a55..f918473 100644 --- a/app/enterprise/controller/Posts.php +++ b/app/enterprise/controller/Posts.php @@ -507,7 +507,15 @@ class Posts extends BaseController $pid = $this->request->param('pid', 0); $reply_user_id = 0; if (!empty($pid)) { - $reply_user_id = Comment::where('id', $pid)->value('user_id'); + $reply_comment = Comment::where('id', $pid)->field('user_id,type,relevance_id')->find(); + if ($reply_comment) { + $reply_user_id = $reply_comment['user_id']; + if ($reply_comment['type'] != 1 || $reply_comment['relevance_id'] != $posts_id) { + return error(lang('system.fail')); + } + } else { + return error(lang('system.fail')); + } } $info = [