Skip to content

Commit 1600e3f

Browse files
Comments: Improve comment content filtering.
Merges [44842] to the 4.4 branch. git-svn-id: https://develop.svn.wordpress.org/branches/4.4@44850 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b7387df commit 1600e3f

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/wp-admin/includes/ajax-actions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,8 @@ function wp_ajax_replyto_comment( $action ) {
10071007
if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
10081008
kses_remove_filters(); // start with a clean slate
10091009
kses_init_filters(); // set up the filters
1010+
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
1011+
add_filter( 'pre_comment_content', 'wp_filter_kses' );
10101012
}
10111013
}
10121014
} else {

src/wp-includes/comment.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,8 @@ function wp_handle_comment_submission( $comment_data ) {
27572757
) {
27582758
kses_remove_filters(); // start with a clean slate
27592759
kses_init_filters(); // set up the filters
2760+
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
2761+
add_filter( 'pre_comment_content', 'wp_filter_kses' );
27602762
}
27612763
}
27622764
} else {

0 commit comments

Comments
 (0)