r63425 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63424‎ | r63425 | r63426 >
Date:22:26, 8 March 2010
Author:reedy
Status:ok
Tags:
Comment:
Restore $wgLang in ApiQueryAllmessages if changed during execution
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryAllmessages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllmessages.php
@@ -42,8 +42,10 @@
4343 public function execute() {
4444 $params = $this->extractRequestParams();
4545
 46+ global $wgLang;
 47+
4648 if ( !is_null( $params['lang'] ) ) {
47 - global $wgLang;
 49+ $oldLang = $wgLang; //Keep $wgLang for restore later
4850 $wgLang = Language::factory( $params['lang'] );
4951 }
5052
@@ -120,6 +122,10 @@
121123 }
122124 }
123125 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'message' );
 126+
 127+ if ( !is_null( $params['lang'] ) ) {
 128+ $wgLang = $oldLang; //Restore $oldLang
 129+ }
124130 }
125131
126132 public function getAllowedParams() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r63463Minor followup to r63425 and r63428...reedy11:52, 9 March 2010

Status & tagging log