Restore $wgLang in ApiQueryAllmessages if changed during execution
This commit is contained in:
parent
bba315b8cc
commit
7dc022fd1f
1 changed files with 7 additions and 1 deletions
|
|
@ -42,8 +42,10 @@ class ApiQueryAllmessages extends ApiQueryBase {
|
|||
public function execute() {
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
global $wgLang;
|
||||
|
||||
if ( !is_null( $params['lang'] ) ) {
|
||||
global $wgLang;
|
||||
$oldLang = $wgLang; //Keep $wgLang for restore later
|
||||
$wgLang = Language::factory( $params['lang'] );
|
||||
}
|
||||
|
||||
|
|
@ -120,6 +122,10 @@ class ApiQueryAllmessages extends ApiQueryBase {
|
|||
}
|
||||
}
|
||||
$result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'message' );
|
||||
|
||||
if ( !is_null( $params['lang'] ) ) {
|
||||
$wgLang = $oldLang; //Restore $oldLang
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllowedParams() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue