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
This commit is contained in:
Andrew Nacin 2010-03-22 14:01:43 +00:00
parent 2e11ca383a
commit 476fcfe595
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}