Skip to content
Permalink
Browse files

WP-r44845: Comments: Improve comment content filtering.

  • Loading branch information...
SergeyBiryukov authored and nylen committed Mar 13, 2019
1 parent d949ee8 commit 1a6e216eb4c6561bcdd0aecb5c8e904f1f217a39
Showing with 4 additions and 0 deletions.
  1. +2 −0 src/wp-admin/includes/ajax-actions.php
  2. +2 −0 src/wp-includes/comment.php
@@ -1023,6 +1023,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 {
@@ -3110,6 +3110,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 {

0 comments on commit 1a6e216

Please sign in to comment.
You can’t perform that action at this time.