WordPress.org

Make WordPress Core

Ticket #8968: spam-awaiting-moderation-r10466.patch

File spam-awaiting-moderation-r10466.patch, 2.1 KB (added by tellyworth, 6 years ago)
  • wp-includes/comment-template.php

     
    811811        $req = get_option('require_name_email'); 
    812812        $commenter = wp_get_current_commenter(); 
    813813        extract($commenter, EXTR_SKIP); 
    814  
     814         
    815815        /** @todo Use API instead of SELECTs. */ 
    816816        if ( $user_ID) { 
    817                 $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) )  ORDER BY comment_date", $post->ID, $user_ID)); 
     817                $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved != '1' ) )  ORDER BY comment_date", $post->ID, $user_ID)); 
    818818        } else if ( empty($comment_author) ) { 
    819819                $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)); 
    820820        } else { 
    821                 $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)); 
     821                $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 != '1' ) ) ORDER BY comment_date", $post->ID, $comment_author, $comment_author_email)); 
    822822        } 
    823823 
    824824        // keep $comments for legacy's sake 
     
    12251225                <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?> 
    12261226                <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?> 
    12271227                </div> 
    1228 <?php if ($comment->comment_approved == '0') : ?> 
     1228<?php if ($comment->comment_approved != '1') : ?> 
    12291229                <em><?php _e('Your comment is awaiting moderation.') ?></em> 
    12301230                <br /> 
    12311231<?php endif; ?>