'Bad Request',
"unknown function " . (string) $this->func_name
);
- } elseif ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true )
+ } elseif ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true )
&& !$wgUser->isAllowed( 'read' ) )
{
wfHttpError(
} else {
wfDebug( __METHOD__ . ' dispatching ' . $this->func_name . "\n" );
- if ( strpos( $this->func_name, '::' ) !== false ) {
- $func = explode( '::', $this->func_name, 2 );
- } else {
- $func = $this->func_name;
- }
-
try {
- $result = call_user_func_array( $func, $this->args );
+ $result = call_user_func_array( $this->func_name, $this->args );
if ( $result === false || $result === null ) {
wfDebug( __METHOD__ . ' ERROR while dispatching '
$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: " .