mirror of
git://develop.git.wordpress.org/
synced 2025-04-19 11:42:26 +02:00
Comments: Improve comment content filtering.
Merges [44842] to the 4.5 branch. git-svn-id: https://develop.svn.wordpress.org/branches/4.5@44849 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3b84dcc1e1
commit
19d2f136fe
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user