[wp-trac] [WordPress Trac] #9035: 304 Not Modified bug introduced
by [10408]
WordPress Trac
wp-trac at lists.automattic.com
Tue Feb 3 23:59:47 GMT 2009
#9035: 304 Not Modified bug introduced by [10408]
--------------------------+-------------------------------------------------
Reporter: tellyworth | Owner: anonymous
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.8
Component: General | Version:
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
[10408] changes the behaviour of mysql2date(), in a way that can cause
WP::send_headers() to incorrectly produce a 304 Not Modified response to
an unconditional GET for feeds.
When the locale is something other than English, this line of code in
send_headers() gets a non-English date:
http://trac.wordpress.org/browser/trunk/wp-includes/classes.php#L330
{{{$wp_last_modified = mysql2date('D, d M Y H:i:s',
get_lastpostmodified('GMT'), 0).' GMT';}}}
That causes $wp_modified_timestamp to be false, which in turn causes the
conditional block below to be true and return a 304 response instead of a
200.
Net result is broken feeds for non-en users.
Two things should be fixed imho:
* either mysql2date() returns to its previous behaviour, or send_headers()
is changed to use a different function to format $wp_last_modified. I'm
not sure that mysql2date is appropriate in this context, when an English-
only GMT date is required.
* the conditional block at the bottom of send_headers() should include a
defensive check so that a 304 response is never produced unless either
IF_MODIFIED_SINCE or IF_NONE_MATCH are set.
--
Ticket URL: <http://trac.wordpress.org/ticket/9035>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list