From 0f59069a7f84ef34a02fd571925ec98b161c4a24 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 31 Aug 2015 20:41:09 +0000 Subject: [PATCH] `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. git-svn-id: https://develop.svn.wordpress.org/trunk@33826 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-comments-list-table.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 49ecaa5cf8..8662bdaa50 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -428,16 +428,13 @@ class WP_Comments_List_Table extends WP_List_Table { } /** - * * @global WP_Post $post - * @global object $comment * - * @param object $a_comment + * @param object $comment */ - public function single_row( $a_comment ) { - global $post, $comment; + public function single_row( $comment ) { + global $post; - $comment = $a_comment; $the_comment_class = wp_get_comment_status( $comment->comment_ID ); if ( ! $the_comment_class ) { $the_comment_class = '';