$maxModified = max( $modifiedTimes );
$this->mLastModified = wfTimestamp( TS_RFC2822, $maxModified );
- if( empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
+ $clientHeader = $this->getRequest()->getHeader( 'If-Modified-Since' );
+ if ( $clientHeader === false ) {
wfDebug( __METHOD__ . ": client did not send If-Modified-Since header\n", false );
return false;
}
- # Make debug info
- $info = '';
- foreach ( $modifiedTimes as $name => $value ) {
- if ( $info !== '' ) {
- $info .= ', ';
- }
- $info .= "$name=" . wfTimestamp( TS_ISO_8601, $value );
- }
-
# IE sends sizes after the date like this:
# Wed, 20 Aug 2003 06:51:19 GMT; length=5202
# this breaks strtotime().
- $clientHeader = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
+ $clientHeader = preg_replace( '/;.*$/', '', $clientHeader );
wfSuppressWarnings(); // E_STRICT system time bitching
$clientHeaderTime = strtotime( $clientHeader );
}
$clientHeaderTime = wfTimestamp( TS_MW, $clientHeaderTime );
+ # Make debug info
+ $info = '';
+ foreach ( $modifiedTimes as $name => $value ) {
+ if ( $info !== '' ) {
+ $info .= ', ';
+ }
+ $info .= "$name=" . wfTimestamp( TS_ISO_8601, $value );
+ }
+
wfDebug( __METHOD__ . ": client sent If-Modified-Since: " .
wfTimestamp( TS_ISO_8601, $clientHeaderTime ) . "\n", false );
wfDebug( __METHOD__ . ": effective Last-Modified: " .