From 22db82dff18d7ed8dccb3102d9713ebf7c54e495 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 23 Sep 2014 03:28:51 +0000 Subject: [PATCH] In `wp_ajax_replyto_comment()`, if `$_POST['comment_type']` is set, use it for the value of `$comment_type`, which the `compact()` call has assumed is set since [8720]. It never was. `wp_comment_reply()`'s output can be complete overridden by the `wp_comment_reply` filter, so this check is justified and makes the AJAX callback more flexible. Props nerrad. Fixes #29704. git-svn-id: https://develop.svn.wordpress.org/trunk@29758 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index ff2db70f9c..799ef1ef8d 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -935,7 +935,8 @@ function wp_ajax_replyto_comment( $action ) { $comment_author = wp_slash( $user->display_name ); $comment_author_email = wp_slash( $user->user_email ); $comment_author_url = wp_slash( $user->user_url ); - $comment_content = trim($_POST['content']); + $comment_content = trim( $_POST['content'] ); + $comment_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : ''; if ( current_user_can( 'unfiltered_html' ) ) { if ( ! isset( $_POST['_wp_unfiltered_html_comment'] ) ) $_POST['_wp_unfiltered_html_comment'] = '';