Skip to content
Permalink
Browse files

Comments: Improve comment content filtering.

Merges [44842] to the 4.9 branch.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@44845 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Mar 12, 2019
1 parent 765262a commit 3e858faef3bdeae6fb86c7e6cbc492a14c1b664c
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
@@ -1070,6 +1070,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 3e858fa

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