From 3baba9fd1777483e2c37ab2b5fe7bbc15893e5e8 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 7 Jan 2011 16:17:05 +0000 Subject: [PATCH] Use edit_comment cap. Props casben79. fixes #16129 git-svn-id: http://svn.automattic.com/wordpress/trunk@17232 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/comment.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php index 74ffa38133..d731130a53 100644 --- a/wp-admin/includes/comment.php +++ b/wp-admin/includes/comment.php @@ -32,10 +32,9 @@ function comment_exists($comment_author, $comment_date) { * @since 2.0.0 */ function edit_comment() { - $comment_post_ID = (int) $_POST['comment_post_ID']; - if (!current_user_can( 'edit_post', $comment_post_ID )) - wp_die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.' ) ); + if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) ) + wp_die ( __( 'You are not allowed to edit comments on this post.' ) ); $_POST['comment_author'] = $_POST['newcomment_author']; $_POST['comment_author_email'] = $_POST['newcomment_author_email'];