diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 85c0af926e..2e9e205ba2 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -227,7 +227,7 @@ function get_comments( $args = '' ) { } if ( ! empty($post_id) ) - $post_where = "comment_post_ID = $post_id AND"; + $post_where = $wpdb->prepare( 'comment_post_ID = %d AND', $post_id ); else $post_where = '';