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
This commit is contained in:
Scott Taylor 2015-08-31 20:41:09 +00:00
parent 20767f42aa
commit 0f59069a7f

View File

@ -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 = '';