From 948284b296941e866ec0285722be8f9b069ee94c Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 16 Aug 2007 19:26:01 +0000 Subject: [PATCH] Don't update comments feed last-modified header for unapproved comments. Props James Ballantine and Nazgul. fixes #4618 for 2.3 git-svn-id: http://svn.automattic.com/wordpress/trunk@5885 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 4c3b9faa48..7f36a45abe 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -138,13 +138,13 @@ function get_lastcommentmodified($timezone = 'server') { if ( !isset($cache_lastcommentmodified[$timezone]) ) { switch ( strtolower($timezone)) { case 'gmt': - $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); + $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_date_gmt <= '$now' AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1"); break; case 'blog': - $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); + $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_date_gmt <= '$now' AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1"); break; case 'server': - $lastcommentmodified = $wpdb->get_var("SELECT DATE_ADD(comment_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->comments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); + $lastcommentmodified = $wpdb->get_var("SELECT DATE_ADD(comment_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->comments WHERE comment_date_gmt <= '$now' AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1"); break; } $cache_lastcommentmodified[$timezone] = $lastcommentmodified;