Show pending comments to users with quotes in their name. props regulatethis. fixes #6992

git-svn-id: http://svn.automattic.com/wordpress/trunk@9773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-11-19 04:58:10 +00:00
parent f7fdaa9884
commit cad8e31e39
1 changed files with 1 additions and 1 deletions

View File

@ -793,7 +793,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false
} else if ( empty($comment_author) ) {
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post->ID));
} else {
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date", $post->ID, $comment_author, $comment_author_email));
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date", $post->ID, htmlspecialchars_decode($comment_author, ENT_QUOTES), $comment_author_email));
}
// keep $comments for legacy's sake