From ec51b64e786ad22a5a0724856fbfd5bf8949249b Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 3 Jul 2022 00:15:10 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20#1928=20=EB=8C=93=EA=B8=80=20=EC=9E=90?= =?UTF-8?q?=EB=A6=AC=20=EB=82=A8=EA=B9=80=20+=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=EC=8B=9C=20=ED=9C=B4=EC=A7=80=ED=86=B5=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EB=8F=99=EC=8B=9C=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=8B=9C=20=EB=8C=93=EA=B8=80=20=EB=82=B4=EC=9A=A9=EC=9D=B4=20?= =?UTF-8?q?=EC=9C=A0=EC=8B=A4=EB=90=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/comment/comment.controller.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 9830de5e6..c60fc5d70 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -911,7 +911,9 @@ class commentController extends comment { return new BaseObject(-1, 'msg_invalid_request'); } - $comment = getModel('comment')->getComment($obj->comment_srl); + + // check if comment exists and permission is granted + $comment = CommentModel::getComment($obj->comment_srl); if(!$comment->isExists()) { return new BaseObject(-1, 'msg_not_founded'); @@ -928,17 +930,6 @@ class commentController extends comment return $output; } - // check if comment exists and permission is granted - $comment = CommentModel::getComment($obj->comment_srl); - if(!$comment->isExists()) - { - return new BaseObject(-1, 'msg_not_founded'); - } - if(!$is_admin && !$comment->isGranted()) - { - return new BaseObject(-1, 'msg_not_permitted'); - } - // If the case manager to delete comments, it indicated that the administrator deleted. $logged_info = Context::get('logged_info'); if($is_admin === true && $obj->member_srl !== $logged_info->member_srl) @@ -1197,7 +1188,7 @@ class commentController extends comment function moveCommentToTrash($obj, $updateComment = false) { // check if comment exists and permission is granted - $oComment = CommentModel::getComment($obj->comment_srl); + $oComment = ($obj instanceof commentItem) ? $obj : CommentModel::getComment($obj->comment_srl); if(!$oComment->isExists()) { return new BaseObject(-1, 'msg_not_founded');