From a025ce4f1215102d25ba14205c5acd8583b25624 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 10 Sep 2015 03:11:09 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@33986 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-comments-list-table.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 e8082bbb16..d8845e8eb9 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -448,13 +448,16 @@ class WP_Comments_List_Table extends WP_List_Table { } $the_comment_class = join( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) ); - $post = get_post( $comment->comment_post_ID ); - + if ( $comment->comment_post_ID > 0 ) { + $post = get_post( $comment->comment_post_ID ); + } $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID ); echo ""; $this->single_row_columns( $comment ); echo "\n"; + + $post = null; } /**