diff --git a/wp-blog-header.php b/wp-blog-header.php index 3f98ede1ac..117b9c1f64 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -114,10 +114,13 @@ if (is_404()) { @header ('X-Pingback: '. get_bloginfo('pingback_url')); } else { // We're showing a feed, so WP is indeed the only thing that last changed - $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; + if ( $withcomments ) + $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT'; + else + $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; $wp_etag = '"' . md5($wp_last_modified) . '"'; - @header('Last-Modified: '.$wp_last_modified); - @header('ETag: '.$wp_etag); + @header("Last-Modified: $wp_last_modified"); + @header("ETag: $wp_etag"); @header ('X-Pingback: ' . get_bloginfo('pingback_url')); // Support for Conditional GET diff --git a/wp-commentsrss2.php b/wp-commentsrss2.php index f8ed8f3245..0dc406286f 100644 --- a/wp-commentsrss2.php +++ b/wp-commentsrss2.php @@ -1,5 +1,6 @@ get_var("SELECT comment_date_gmt FROM $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); + break; + case 'blog': + $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_date_gmt <= '$now' 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 $tablecomments WHERE comment_date_gmt <= '$now' ORDER BY comment_date_gmt DESC LIMIT 1"); + break; + } + $cache_lastcommentmodified[$timezone] = $lastcommentmodified; + } else { + $lastcommentmodified = $cache_lastcommentmodified[$timezone]; + } + return $lastcommentmodified; +} + function user_pass_ok($user_login,$user_pass) { global $cache_userdata; if ( empty($cache_userdata[$user_login]) ) {