From 62ea5faef5b134ed5ff9650c62758fb905193465 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 14 Oct 2004 08:27:56 +0000 Subject: [PATCH] Fix for bug 137. Patch from kelson. git-svn-id: http://svn.automattic.com/wordpress/trunk@1799 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-blog-header.php | 9 ++++++--- wp-commentsrss2.php | 3 ++- wp-includes/functions.php | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) 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]) ) {