WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/26/2013 03:39:12 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Avoid an undefined index notice when submitting a comment with JavaScript disabled. fixes #24752.

File:
1 edited

Legend:

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

    r25001 r25121  
    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') ) {
    64         if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) {
     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'] ) {
    6565            kses_remove_filters(); // start with a clean slate
    6666            kses_init_filters(); // set up the filters
Note: See TracChangeset for help on using the changeset viewer.