r88505 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88504‎ | r88505 | r88506 >
Date:00:28, 21 May 2011
Author:preilly
Status:ok
Tags:
Comment:
fix use of globals and switch to using getDir method
Modified paths:
  • /trunk/extensions/PatchOutputMobile/PatchOutputMobile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PatchOutputMobile/PatchOutputMobile.php
@@ -27,7 +27,7 @@
2828 'onOutputPageBeforeHTML' );
2929
3030 class ExtPatchOutputMobile {
31 - const VERSION = '0.3.1';
 31+ const VERSION = '0.3.2';
3232
3333 private $doc;
3434
@@ -72,6 +72,7 @@
7373 );
7474
7575 public function onOutputPageBeforeHTML( &$out, &$text ) {
 76+ global $wgContLang;
7677 // Need to stash the results of the "wfMsg" call before the Output Buffering handler
7778 // because at this point the database connection is shut down, etc.
7879 ExtPatchOutputMobile::$messages['patch-output-mobile-show'] = wfMsg( 'show_button' );
@@ -82,8 +83,8 @@
8384 ExtPatchOutputMobile::$messages['copyright'] = wfMsg( 'copyright' );
8485 ExtPatchOutputMobile::$messages['home_button'] = wfMsg( 'home_button' );
8586 ExtPatchOutputMobile::$messages['random_button'] = wfMsg( 'random_button' );
86 - ExtPatchOutputMobile::$dir = $GLOBALS['wgContLang']->isRTL() ? "rtl" : "ltr";
87 - ExtPatchOutputMobile::$code = $GLOBALS['wgContLang']->getCode();
 87+ ExtPatchOutputMobile::$dir = $wgContLang->getDir();
 88+ ExtPatchOutputMobile::$code = $wgContLang->getCode();
8889
8990 $userAgent = $_SERVER['HTTP_USER_AGENT'];
9091 $acceptHeader = $_SERVER["HTTP_ACCEPT"];

Status & tagging log