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
This commit is contained in:
Scott Taylor 2014-09-23 03:28:51 +00:00
parent e97e5048c3
commit 22db82dff1
1 changed files with 2 additions and 1 deletions

View File

@ -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'] = '';