diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
commit | d9022f63880ce039446fba8364f68e656b7bf4cb (patch) | |
tree | 16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/specials/SpecialBlockme.php | |
parent | 27cf83d177256813e2e802241085fce5dd0f3fb9 (diff) |
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/specials/SpecialBlockme.php')
-rw-r--r-- | includes/specials/SpecialBlockme.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/includes/specials/SpecialBlockme.php b/includes/specials/SpecialBlockme.php index 40747667..3840b2ff 100644 --- a/includes/specials/SpecialBlockme.php +++ b/includes/specials/SpecialBlockme.php @@ -33,18 +33,19 @@ class SpecialBlockme extends UnlistedSpecialPage { } function execute( $par ) { - global $wgRequest, $wgOut, $wgBlockOpenProxies, $wgProxyKey; + global $wgBlockOpenProxies, $wgProxyKey; $this->setHeaders(); $this->outputHeader(); - $ip = wfGetIP(); - if( !$wgBlockOpenProxies || $wgRequest->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) { - $wgOut->addWikiMsg( 'proxyblocker-disabled' ); + $ip = $this->getRequest()->getIP(); + if( !$wgBlockOpenProxies || $this->getRequest()->getText( 'ip' ) != md5( $ip . $wgProxyKey ) ) { + $this->getOutput()->addWikiMsg( 'proxyblocker-disabled' ); return; } - $user = User::newFromName( wfMsgForContent( 'proxyblocker' ) ); + $user = User::newFromName( $this->msg( 'proxyblocker' )->inContentLanguage()->text() ); + # FIXME: newFromName could return false on a badly configured wiki. if ( !$user->isLoggedIn() ) { $user->addToDatabase(); } @@ -52,10 +53,10 @@ class SpecialBlockme extends UnlistedSpecialPage { $block = new Block(); $block->setTarget( $ip ); $block->setBlocker( $user ); - $block->mReason = wfMsg( 'proxyblockreason' ); + $block->mReason = $this->msg( 'proxyblockreason' )->inContentLanguage()->text(); $block->insert(); - $wgOut->addWikiMsg( 'proxyblocksuccess' ); + $this->getOutput()->addWikiMsg( 'proxyblocksuccess' ); } } |