r95109 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95108‎ | r95109 | r95110 >
Date:20:12, 20 August 2011
Author:ialex
Status:ok
Tags:
Comment:
Use local context instead of global variables
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRandompage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRandompage.php
@@ -54,9 +54,9 @@
5555 }
5656
5757 public function execute( $par ) {
58 - global $wgOut, $wgContLang, $wgRequest;
 58+ global $wgContLang;
5959
60 - if ($par) {
 60+ if ( $par ) {
6161 $this->setNamespace( $wgContLang->getNsIndex( $par ) );
6262 }
6363
@@ -64,15 +64,15 @@
6565
6666 if( is_null( $title ) ) {
6767 $this->setHeaders();
68 - $wgOut->addWikiMsg( strtolower( $this->getName() ) . '-nopages',
 68+ $this->getOutput()->addWikiMsg( strtolower( $this->getName() ) . '-nopages',
6969 $this->getNsList(), count( $this->namespaces ) );
7070 return;
7171 }
7272
7373 $redirectParam = $this->isRedirect() ? array( 'redirect' => 'no' ) : array();
74 - $query = array_merge( $wgRequest->getValues(), $redirectParam );
 74+ $query = array_merge( $this->getRequest()->getValues(), $redirectParam );
7575 unset( $query['title'] );
76 - $wgOut->redirect( $title->getFullUrl( $query ) );
 76+ $this->getOutput()->redirect( $title->getFullUrl( $query ) );
7777 }
7878
7979 /**

Status & tagging log