Skip to content

Commit 0292de6

Browse files
Comments: Improve comment content filtering.
Built from https://develop.svn.wordpress.org/trunk@44842 git-svn-id: http://core.svn.wordpress.org/trunk@44674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 2504efc commit 0292de6

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Diff for: wp-admin/includes/ajax-actions.php

+2
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,8 @@ function wp_ajax_replyto_comment( $action ) {
12141214
if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
12151215
kses_remove_filters(); // start with a clean slate
12161216
kses_init_filters(); // set up the filters
1217+
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
1218+
add_filter( 'pre_comment_content', 'wp_filter_kses' );
12171219
}
12181220
}
12191221
} else {

Diff for: wp-includes/comment.php

+2
Original file line numberDiff line numberDiff line change
@@ -3243,6 +3243,8 @@ function wp_handle_comment_submission( $comment_data ) {
32433243
) {
32443244
kses_remove_filters(); // start with a clean slate
32453245
kses_init_filters(); // set up the filters
3246+
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
3247+
add_filter( 'pre_comment_content', 'wp_filter_kses' );
32463248
}
32473249
}
32483250
} else {

Diff for: wp-includes/version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @global string $wp_version
1515
*/
16-
$wp_version = '5.2-alpha-44833';
16+
$wp_version = '5.2-alpha-44842';
1717

1818
/**
1919
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)