From ed83979728de51c05ae12389a441a03baef7a6b1 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 12 Sep 2015 07:19:25 +0000 Subject: [PATCH] AJAX Reply to Comment: check the `edit_comment` cap when parent comment will be auto-approved. Props rachelbaker. Fixes #23939. Built from https://develop.svn.wordpress.org/trunk@34074 git-svn-id: http://core.svn.wordpress.org/trunk@34042 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index a4feb6f0dd..e0391dc970 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -1011,6 +1011,10 @@ function wp_ajax_replyto_comment( $action ) { $parent = get_comment( $comment_parent ); if ( $parent && $parent->comment_approved === '0' && $parent->comment_post_ID == $comment_post_ID ) { + if ( ! current_user_can( 'edit_comment', $parent->comment_ID ) ) { + wp_die( -1 ); + } + if ( wp_set_comment_status( $parent->comment_ID, 'approve' ) ) $comment_auto_approved = true; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 28dfdbbac9..51891d2f69 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34073'; +$wp_version = '4.4-alpha-34074'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.