mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-01 08:37:55 +02:00
Comments: Improve comment content filtering.
Merges [44842] to the 4.9 branch. Built from https://develop.svn.wordpress.org/branches/4.9@44845 git-svn-id: http://core.svn.wordpress.org/branches/4.9@44677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9940eb5493
commit
176bfb2694
@ -1070,6 +1070,8 @@ function wp_ajax_replyto_comment( $action ) {
|
|||||||
if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
|
if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
|
||||||
kses_remove_filters(); // start with a clean slate
|
kses_remove_filters(); // start with a clean slate
|
||||||
kses_init_filters(); // set up the filters
|
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 {
|
} else {
|
||||||
|
@ -3110,6 +3110,8 @@ function wp_handle_comment_submission( $comment_data ) {
|
|||||||
) {
|
) {
|
||||||
kses_remove_filters(); // start with a clean slate
|
kses_remove_filters(); // start with a clean slate
|
||||||
kses_init_filters(); // set up the filters
|
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 {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user