Make WordPress Core

Changeset 33986


Ignore:
Timestamp:
09/10/2015 03:11:09 AM (9 years ago)
Author:
wonderboymusic
Message:

After the global churn in [33964], also set $post to null at the end of WP_Comments_List_Table::single_row() to ensure that an orphaned comment doesn't inherit the previous row's $post context.

See #33638.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r33964 r33986  
    449449        $the_comment_class = join( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) );
    450450
    451         $post = get_post( $comment->comment_post_ID );
    452 
     451        if ( $comment->comment_post_ID > 0 ) {
     452            $post = get_post( $comment->comment_post_ID );
     453        }
    453454        $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
    454455
     
    456457        $this->single_row_columns( $comment );
    457458        echo "</tr>\n";
     459
     460        $post = null;
    458461    }
    459462
Note: See TracChangeset for help on using the changeset viewer.