*/
public function request( WebRequest $x = null ) {
$old = $this->context->getRequest();
- $this->context->setRequest( $x );
+ if ( $x ) {
+ $this->context->setRequest( $x );
+ }
return $old;
}
*/
public function output( OutputPage $x = null ) {
$old = $this->context->getOutput();
- $this->context->setOutput( $x );
+ if ( $x ) {
+ $this->context->setOutput( $x );
+ }
return $old;
}
// Check user's permissions to read this page.
// We have to check here to catch special pages etc.
// We will check again in Article::view().
- $permErrors = $title->getUserPermissionsErrors( 'read', $user );
+ $permErrors = $title->isSpecial( 'RunJobs' )
+ ? array() // relies on HMAC key signature alone
+ : $title->getUserPermissionsErrors( 'read', $user );
if ( count( $permErrors ) ) {
// Bug 32276: allowing the skin to generate output with $wgTitle or
// $this->context->title set to the input title would allow anonymous users to
// to fail due to post data being lost, but let's try anyway
// and just log the instance.
//
- // @todo @fixme See if we could issue a 307 or 308 here, need
+ // @todo FIXME: See if we could issue a 307 or 308 here, need
// to see how clients (automated & browser) behave when we do
wfDebugLog( 'RedirectedPosts', "Redirected from HTTP to HTTPS: $oldUrl" );
}
}
if ( !$wgRunJobsAsync ) {
- // If running jobs asynchronously has been disabled, run the job here
- // while the user waits
- SpecialRunJobs::executeJobs( $n );
+ // Fall back to running the job here while the user waits
+ $runner = new JobRunner();
+ $runner->run( array( 'maxJobs' => $n ) );
return;
}
if ( !$sock ) {
wfDebugLog( 'runJobs', "Failed to start cron API (socket error $errno): $errstr\n" );
// Fall back to running the job here while the user waits
- SpecialRunJobs::executeJobs( $n );
+ $runner = new JobRunner();
+ $runner->run( array( 'maxJobs' => $n ) );
return;
}