From 476fcfe595e67923283edc9786e96f17f2fc7ddc Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@13800 602fd350-edb4-49c9-b593-d223f7449a82 --- 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; }