#1783 closed defect (bug) (fixed)
Use GMT when retrieving comments for the RSS feed
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 1.6 |
Component: | General | Keywords: | bg|needs-testing bg|has-patch |
Focuses: | Cc: |
Description
There are three different date/time sets. One is the UTC/GMT time. The other is the Blog time as set in the Administration Panel. That is the time zone the blogger lives in. The third is the hosting server time zone.
When the blogger posts a new entry, it is marked by the Blog Time, as well as the GMT time. However, it appears then when the comments are retrieved for the post or the posts, the post/posts are looked up by the hosting server's time comparing it against the Blog Time stored for the posts. That leads to, for instance, for the comments not appearing in the RSS feed until the hosting server's time reaches the Blog Time.
The fix is to use GMT time for the current time and GMT time stored in the database for the posts. Please see the diff below against WP 1.5.2 version of wp-commentsrss2.php:
$ diff wp/wp-commentsrss2.php.saved wp/wp-commentsrss2.php 37,38c37,38 < AND post_date < '".date("Y-m-d H:i:59")."' < ORDER BY comment_date DESC LIMIT " . get_settings('posts_per_rss') ); --- > AND post_date_gmt < '".gmdate("Y-m-d H:i:59")."' > ORDER BY comment_date_gmt DESC LIMIT " . get_settings('posts_per_rss') ); 44,45c44,45 < AND $wpdb->comments.comment_approved = '1' AND post_date < '".date("Y-m-d H:i:s")."' < ORDER BY comment_date DESC LIMIT " . get_settings('posts_per_rss') ); --- > AND $wpdb->comments.comment_approved = '1' AND post_date_gmt < '".gmdate("Y-m-d H:i:s")."' > ORDER BY comment_date_gmt DESC LIMIT " . get_settings('posts_per_rss') );
(In [3076]) Fixes #1783