diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 954ffb4f16..09d256847a 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -1009,6 +1009,8 @@ function wp_ajax_replyto_comment( $action ) { if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) { kses_remove_filters(); // start with a clean slate kses_init_filters(); // set up the filters + remove_filter( 'pre_comment_content', 'wp_filter_post_kses' ); + add_filter( 'pre_comment_content', 'wp_filter_kses' ); } } } else { diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 92354d6f17..635cb59f97 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -2867,6 +2867,8 @@ function wp_handle_comment_submission( $comment_data ) { ) { kses_remove_filters(); // start with a clean slate kses_init_filters(); // set up the filters + remove_filter( 'pre_comment_content', 'wp_filter_post_kses' ); + add_filter( 'pre_comment_content', 'wp_filter_kses' ); } } } else {