diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index ffb80e2369..49276b4bd0 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -1297,12 +1297,10 @@ function wp_ajax_replyto_comment( $action ) { $user = wp_get_current_user(); if ( $user->exists() ) { - $user_id = $user->ID; $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_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : 'comment'; + $user_id = $user->ID; if ( current_user_can( 'unfiltered_html' ) ) { if ( ! isset( $_POST['_wp_unfiltered_html_comment'] ) ) { @@ -1320,10 +1318,14 @@ function wp_ajax_replyto_comment( $action ) { wp_die( __( 'Sorry, you must be logged in to reply to a comment.' ) ); } + $comment_content = trim( $_POST['content'] ); + if ( '' === $comment_content ) { wp_die( __( 'Please type your comment text.' ) ); } + $comment_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : 'comment'; + $comment_parent = 0; if ( isset( $_POST['comment_ID'] ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index dcb9330dd9..6dd76bf6ca 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53746'; +$wp_version = '6.1-alpha-53747'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.