r96213 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96212‎ | r96213 | r96214 >
Date:20:51, 3 September 2011
Author:ialex
Status:ok
Tags:
Comment:
Use local context instead of global variables
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBlockme.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBlockme.php
@@ -33,14 +33,14 @@
3434 }
3535
3636 function execute( $par ) {
37 - global $wgRequest, $wgOut, $wgBlockOpenProxies, $wgProxyKey;
 37+ global $wgBlockOpenProxies, $wgProxyKey;
3838
3939 $this->setHeaders();
4040 $this->outputHeader();
4141
42 - $ip = $wgRequest->getIP();
43 - if( !$wgBlockOpenProxies || $wgRequest->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) {
44 - $wgOut->addWikiMsg( 'proxyblocker-disabled' );
 42+ $ip = $this->getRequest()->getIP();
 43+ if( !$wgBlockOpenProxies || $this->getRequest()->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) {
 44+ $this->getOutput()->addWikiMsg( 'proxyblocker-disabled' );
4545 return;
4646 }
4747
@@ -56,6 +56,6 @@
5757
5858 $block->insert();
5959
60 - $wgOut->addWikiMsg( 'proxyblocksuccess' );
 60+ $this->getOutput()->addWikiMsg( 'proxyblocksuccess' );
6161 }
6262 }

Status & tagging log