Fix for bug 137. Patch from kelson.
git-svn-id: https://develop.svn.wordpress.org/trunk@1799 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
53316541a9
commit
8485291bd9
|
@ -114,10 +114,13 @@ if (is_404()) {
|
||||||
@header ('X-Pingback: '. get_bloginfo('pingback_url'));
|
@header ('X-Pingback: '. get_bloginfo('pingback_url'));
|
||||||
} else {
|
} else {
|
||||||
// We're showing a feed, so WP is indeed the only thing that last changed
|
// We're showing a feed, so WP is indeed the only thing that last changed
|
||||||
|
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_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
|
||||||
$wp_etag = '"' . md5($wp_last_modified) . '"';
|
$wp_etag = '"' . md5($wp_last_modified) . '"';
|
||||||
@header('Last-Modified: '.$wp_last_modified);
|
@header("Last-Modified: $wp_last_modified");
|
||||||
@header('ETag: '.$wp_etag);
|
@header("ETag: $wp_etag");
|
||||||
@header ('X-Pingback: ' . get_bloginfo('pingback_url'));
|
@header ('X-Pingback: ' . get_bloginfo('pingback_url'));
|
||||||
|
|
||||||
// Support for Conditional GET
|
// Support for Conditional GET
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
if ( !$feed ) {
|
if ( !$feed ) {
|
||||||
|
$withcomments = 1;
|
||||||
require('wp-blog-header.php');
|
require('wp-blog-header.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,30 @@ function get_lastpostmodified($timezone = 'server') {
|
||||||
return $lastpostmodified;
|
return $lastpostmodified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_lastcommentmodified($timezone = 'server') {
|
||||||
|
global $tablecomments, $cache_lastcommentmodified, $pagenow, $wpdb;
|
||||||
|
$add_seconds_blog = get_settings('gmt_offset') * 3600;
|
||||||
|
$add_seconds_server = date('Z');
|
||||||
|
$now = current_time('mysql', 1);
|
||||||
|
if ( !isset($cache_lastcommentmodified[$timezone]) ) {
|
||||||
|
switch(strtolower($timezone)) {
|
||||||
|
case 'gmt':
|
||||||
|
$lastcommentmodified = $wpdb->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) {
|
function user_pass_ok($user_login,$user_pass) {
|
||||||
global $cache_userdata;
|
global $cache_userdata;
|
||||||
if ( empty($cache_userdata[$user_login]) ) {
|
if ( empty($cache_userdata[$user_login]) ) {
|
||||||
|
|
Loading…
Reference in New Issue