r43957 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43956‎ | r43957 | r43958 >
Date:23:16, 25 November 2008
Author:brion
Status:ok (Comments)
Tags:
Comment:
Horrible hack for {{int:}} usage in CentralNotice so it's using the proper language.
We should really fix core {{int:}}, but I don't want to break things just yet...
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialNoticeText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialNoticeText.php
@@ -159,10 +159,12 @@
160160
161161 private function getMessage( $msg, $params = array() ) {
162162 // A god-damned dirty hack! :D
163 - global $wgSitename;
164163 $old = array();
165 - $old['wgSitename'] = $wgSitename;
 164+ $old['wgSitename'] = $GLOBALS['wgSitename'];
 165+ $old['wgLang'] = $GLOBALS['wgLang'];
 166+
166167 $wgSitename = $this->projectName();
 168+ $wgLang = Language::factory( $this->language ); // hack for {{int:...}}
167169
168170 $options = array(
169171 'language' => $this->language,
@@ -173,7 +175,8 @@
174176 $out = call_user_func_array( 'wfMsgExt', $params );
175177
176178 // Restore globals
177 - $wgSitename = $old['wgSitename'];
 179+ $GLOBALS['wgSitename'] = $old['wgSitename'];
 180+ $GLOBALS['wgLang'] = $wgLang;
178181
179182 return $out;
180183 }

Comments

#Comment by Aaron Schulz (talk | contribs)   22:40, 26 November 2008
  • sigh*

Status & tagging log