Don't update comments feed last-modified header for unapproved comments. Props James Ballantine and Nazgul. fixes #4618 for 2.3

git-svn-id: https://develop.svn.wordpress.org/trunk@5885 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-08-16 19:26:01 +00:00
parent ee08912b51
commit b6f4407016
1 changed files with 3 additions and 3 deletions

View File

@ -138,13 +138,13 @@ function get_lastcommentmodified($timezone = 'server') {
if ( !isset($cache_lastcommentmodified[$timezone]) ) { if ( !isset($cache_lastcommentmodified[$timezone]) ) {
switch ( strtolower($timezone)) { switch ( strtolower($timezone)) {
case 'gmt': 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; break;
case 'blog': 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; break;
case 'server': 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; break;
} }
$cache_lastcommentmodified[$timezone] = $lastcommentmodified; $cache_lastcommentmodified[$timezone] = $lastcommentmodified;