From: Alexandre Emsenhuber Date: Sat, 20 Aug 2011 20:12:46 +0000 (+0000) Subject: Use local context instead of global variables X-Git-Tag: 1.31.0-rc.0~28145 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=87f9a5b82eaddc2692729bbced144e7757dcc07f;p=lhc%2Fweb%2Fwiklou.git Use local context instead of global variables --- diff --git a/includes/specials/SpecialRandompage.php b/includes/specials/SpecialRandompage.php index 68a4a9b937..0b6239bb23 100644 --- a/includes/specials/SpecialRandompage.php +++ b/includes/specials/SpecialRandompage.php @@ -54,9 +54,9 @@ class RandomPage extends SpecialPage { } public function execute( $par ) { - global $wgOut, $wgContLang, $wgRequest; + global $wgContLang; - if ($par) { + if ( $par ) { $this->setNamespace( $wgContLang->getNsIndex( $par ) ); } @@ -64,15 +64,15 @@ class RandomPage extends SpecialPage { if( is_null( $title ) ) { $this->setHeaders(); - $wgOut->addWikiMsg( strtolower( $this->getName() ) . '-nopages', + $this->getOutput()->addWikiMsg( strtolower( $this->getName() ) . '-nopages', $this->getNsList(), count( $this->namespaces ) ); return; } $redirectParam = $this->isRedirect() ? array( 'redirect' => 'no' ) : array(); - $query = array_merge( $wgRequest->getValues(), $redirectParam ); + $query = array_merge( $this->getRequest()->getValues(), $redirectParam ); unset( $query['title'] ); - $wgOut->redirect( $title->getFullUrl( $query ) ); + $this->getOutput()->redirect( $title->getFullUrl( $query ) ); } /**