X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FMediaWiki.php;h=1b014f6f649dedd5ac8f1ae97f57d3f57e32c9f6;hb=cafcb6b2258a10746409135037baa9ac4ab6089e;hp=a8bafa3f469af594147170cf4afaef55937af065;hpb=9c3b9ef639dd015b652dc05dc6cdf26396b89463;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index a8bafa3f46..1b014f6f64 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -38,7 +38,9 @@ class MediaWiki { */ public function request( WebRequest $x = null ) { $old = $this->context->getRequest(); - $this->context->setRequest( $x ); + if ( $x ) { + $this->context->setRequest( $x ); + } return $old; } @@ -48,7 +50,9 @@ class MediaWiki { */ public function output( OutputPage $x = null ) { $old = $this->context->getOutput(); - $this->context->setOutput( $x ); + if ( $x ) { + $this->context->setOutput( $x ); + } return $old; } @@ -198,7 +202,9 @@ class MediaWiki { // 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 @@ -558,7 +564,7 @@ class MediaWiki { // 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" ); } @@ -660,9 +666,9 @@ class MediaWiki { } 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; } @@ -695,7 +701,8 @@ class MediaWiki { 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; }