From 434ccb0ce012cffb0c2e2593d188104a06d3c32b Mon Sep 17 00:00:00 2001 From: azaozz Date: Fri, 17 Apr 2009 00:48:41 +0000 Subject: [PATCH] Hide email addresses from low privilege users on the comments page, props mrmist, fixes #8801 git-svn-id: http://svn.automattic.com/wordpress/trunk@10970 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 41e706e66c..23926fff07 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2065,6 +2065,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $comment = get_comment( $comment_id ); $post = get_post($comment->comment_post_ID); $the_comment_status = wp_get_comment_status($comment->comment_ID); + $user_can = current_user_can('edit_post', $post->ID); $author_url = get_comment_author_url(); if ( 'http://' == $author_url ) @@ -2102,7 +2103,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, case 'cb': if ( !$checkbox ) break; echo ''; - if ( current_user_can('edit_post', $post->ID) ) echo ""; + if ( $user_can ) echo ""; echo ''; break; case 'comment': @@ -2113,15 +2114,15 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, comment_text(); ?> ID) ) { + if ( $user_can ) { $actions['approve'] = "" . __( 'Approve' ) . ''; $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; if ( $comment_status ) { // not looking at all comments @@ -2164,7 +2165,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, echo ""; comment_author(); echo '
'; if ( !empty($author_url) ) echo "$author_url_display
"; - if ( current_user_can( 'edit_post', $post->ID ) ) { + if ( $user_can ) { if ( !empty($comment->comment_author_email) ) { comment_author_email_link(); echo '
'; @@ -2191,7 +2192,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $_comment_pending_count_temp = (array) get_pending_comments_num( array( $post->ID ) ); $pending_comments = $_comment_pending_count[$post->ID] = $_comment_pending_count_temp[$post->ID]; } - if ( current_user_can( 'edit_post', $post->ID ) ) { + if ( $user_can ) { $post_link = ""; $post_link .= get_the_title($post->ID) . ''; } else {