Make WordPress Core

Changeset 33826


Ignore:
Timestamp:
08/31/2015 08:41:09 PM (10 years ago)
Author:
wonderboymusic
Message:

WP_Comments_List_Table::single_row() has no reason to set the $comment global. No other methods use it, and we are not in template/loop context. This can mess with the response of get_comment() elsewhere, since get_comment() internally bypasses the cache/db when a global is set.

See #11566.

File:
1 edited

Legend:

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

    r33825 r33826  
    429429
    430430    /**
    431      *
    432431     * @global WP_Post $post
    433      * @global object  $comment
    434      *
    435      * @param object $a_comment
    436      */
    437     public function single_row( $a_comment ) {
    438         global $post, $comment;
    439 
    440         $comment = $a_comment;
     432     *
     433     * @param object $comment
     434     */
     435    public function single_row( $comment ) {
     436        global $post;
     437
    441438        $the_comment_class = wp_get_comment_status( $comment->comment_ID );
    442439        if ( ! $the_comment_class ) {
Note: See TracChangeset for help on using the changeset viewer.