From 59c4af548b6a09307240ef6acc67b31ebf1706c6 Mon Sep 17 00:00:00 2001 From: nacin Date: Mon, 22 Mar 2010 14:01:43 +0000 Subject: [PATCH] Check cap before showing comments from private posts in recent comments dashboard widget. fixes #9144. git-svn-id: http://svn.automattic.com/wordpress/trunk@13800 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 418c233a71..6526ecf126 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -512,7 +512,7 @@ function wp_dashboard_recent_comments() { foreach ( $possible as $comment ) { if ( count( $comments ) >= $total_items ) break; - if ( in_array( $comment->comment_approved, $allowed_states ) ) + if ( in_array( $comment->comment_approved, $allowed_states ) && current_user_can( 'read_post', $comment->comment_post_ID ) ) $comments[] = $comment; }