Package: wordpress
Version: 2.0.10-1

When a comment is submitted to a post and goes into 'pending moderator approval' status, the Last-Modifed and ETag HTTP headers on the Comments RSS feed are updated as if there is already new content in this feed.

Later, when the comment is approved, the headers are not updated again. This means that some RSS readers (eg: Liferea) do not notice the newly-approved comment, since they won't re-fetch a feed unless its headers say there is something new.

A suggested patch is attached to this email (I'm not sure if that's the right way to submit patches - sorry if it isn't).

I am running Debian GNU/Linux 4.0.

Thanks,
James
diff -ur wordpress/wp-includes/comment-functions.php 
wordpress-mod/wp-includes/comment-functions.php
--- wordpress/wp-includes/comment-functions.php 2007-03-26 09:12:38.000000000 
+1000
+++ wordpress-mod/wp-includes/comment-functions.php     2007-06-15 
01:04:50.000000000 +1000
@@ -549,13 +549,13 @@
        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;

Reply via email to