diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 15751eb995..decf409e67 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -1020,6 +1020,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/src/wp-includes/comment.php b/src/wp-includes/comment.php index ba60070fd7..5f9b278a5d 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -3050,6 +3050,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 {