diff options
author | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2019-03-12 22:34:00 +0000 |
---|---|---|
committer | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2019-03-12 22:34:00 +0000 |
commit | 3e858faef3bdeae6fb86c7e6cbc492a14c1b664c (patch) | |
tree | 749d093289f99b4aa8d71d86f39615facc8b539c /src | |
parent | 765262a5c76a9cd19ceacba596775b74d4b49026 (diff) | |
download | wordpress-3e858faef3bdeae6fb86c7e6cbc492a14c1b664c.tar.gz wordpress-3e858faef3bdeae6fb86c7e6cbc492a14c1b664c.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/wp-admin/includes/ajax-actions.php | 2 | ||||
-rw-r--r-- | src/wp-includes/comment.php | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index a5857b6832..b4b87cf1ca 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.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 { diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 0ff803327a..fe86f0f808 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -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 { |