X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiParse.php;h=0b1f4dbb1bafb66b4881aedb9fc54375bf19db7e;hb=ed4d1a0847c771fe963eac3ccaf3d18e4df0cd7d;hp=06fdf85bbbbfa6010b2d0dfef47c3f91ad2c31b7;hpb=a04d94d4f22f8fa1be0a0e9a8b0bda5a9e003b28;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 06fdf85bbb..0b1f4dbb1b 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -79,16 +79,6 @@ class ApiParse extends ApiBase { // TODO: Does this still need $wgTitle? global $wgParser, $wgTitle; - // Currently unnecessary, code to act as a safeguard against any change - // in current behavior of uselang - $oldLang = null; - if ( isset( $params['uselang'] ) - && $params['uselang'] != $this->getContext()->getLanguage()->getCode() - ) { - $oldLang = $this->getContext()->getLanguage(); // Backup language - $this->getContext()->setLanguage( Language::factory( $params['uselang'] ) ); - } - $redirValues = null; // Return result @@ -409,10 +399,6 @@ class ApiParse extends ApiBase { ); $this->setIndexedTagNames( $result_array, $result_mapping ); $result->addValue( null, $this->getModuleName(), $result_array ); - - if ( !is_null( $oldLang ) ) { - $this->getContext()->setLanguage( $oldLang ); // Reset language to $oldLang - } } /** @@ -499,7 +485,7 @@ class ApiParse extends ApiBase { $entry['lang'] = $bits[0]; if ( $title ) { $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ); - // localised language name in user language (maybe set by uselang=) + // localised language name in 'uselang' language $entry['langname'] = Language::fetchLanguageName( $title->getInterwiki(), $this->getLanguage()->getCode() @@ -704,7 +690,6 @@ class ApiParse extends ApiBase { 'pst' => false, 'onlypst' => false, 'effectivelanglinks' => false, - 'uselang' => null, 'section' => null, 'disablepp' => false, 'disableeditsection' => false, @@ -771,7 +756,6 @@ class ApiParse extends ApiBase { 'Returns the same wikitext, after a PST has been applied.', "Only valid when used with {$p}text", ), - 'uselang' => 'Which language to parse the request in', 'section' => 'Only retrieve the content of this section number', 'disablepp' => 'Disable the PP Report from the parser output', 'disableeditsection' => 'Disable edit section links from the parser output',