Make WordPress Core

Opened 19 years ago

Closed 19 years ago

#1378 closed defect (bug) (duplicate)

Bug with Conditional GET in wp-blog-header.php not resolved

Reported by: netspy's profile netspy Owned by: ryan's profile ryan
Milestone: Priority: normal
Severity: minor Version: 1.5.1
Component: General Keywords:
Focuses: Cc:

Description

The patch for bug #1356 is IMO not correct. A conditional GET request with IF_NONE_MATCH will produce an PHP warning:

PHP Warning: strtotime() [<a href='function.strtotime'>function.strtotime</a>]: Called with an empty time parameter. in /.../wp-blog-header.php on line 139

Here my version of the patch:

if (($client_last_modified && (strtotime($client_last_modified) >= strtotime($wp_last_modified)))

($client_etag && ($client_etag == $wp_etag))) {

if ( preg_match('/cgi/',php_sapi_name()) ) {

header('Status: 304 Not Modified');
echo "\r\n\r\n";
exit;

} else {

if ( version_compare(phpversion(), '4.3.0', '>=') )

header('Not Modified', TRUE, 304);

else

header('HTTP/1.x 304 Not Modified');

exit;

}

}

This works fine with IF_MODIFIED_SINCE and IF_NONE_MATCH requests.

Change History (2)

#1 @netspy
19 years ago

  • Patch set to No

#2 @ryan
19 years ago

  • duplicate_id changed from 0 to 1323
  • Owner changed from anonymous to rboren
  • Resolution changed from 10 to 60
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.