WordPress.org

Make WordPress Core

Changeset 25137


Ignore:
Timestamp:
08/27/2013 01:56:17 PM (8 years ago)
Author:
duck_
Message:

Initialize kses filters if _wp_unfiltered_html_comment nonce isn't set.

See #24752.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-comments-post.php

    r25121 r25137  
    6161    $comment_author_email = wp_slash( $user->user_email );
    6262    $comment_author_url   = wp_slash( $user->user_url );
    63     if ( current_user_can( 'unfiltered_html' ) && isset( $_POST['_wp_unfiltered_html_comment'] ) ) {
    64         if ( wp_create_nonce( 'unfiltered-html-comment_' . $comment_post_ID ) != $_POST['_wp_unfiltered_html_comment'] ) {
     63    if ( current_user_can( 'unfiltered_html' ) ) {
     64        if ( ! isset( $_POST['_wp_unfiltered_html_comment'] )
     65            || ! wp_verify_nonce( $_POST['_wp_unfiltered_html_comment'], 'unfiltered-html-comment_' . $comment_post_ID )
     66        ) {
    6567            kses_remove_filters(); // start with a clean slate
    6668            kses_init_filters(); // set up the filters
Note: See TracChangeset for help on using the changeset viewer.