* @file
*/
+use MediaWiki\MediaWikiServices;
+
/**
* A query action to get image information and upload history.
*
* @return array Result array
*/
public static function getInfo( $file, $prop, $result, $thumbParams = null, $opts = false ) {
- global $wgContLang;
-
$anyHidden = false;
if ( !$opts || is_string( $opts ) ) {
$opts = [
'version' => $opts ?: 'latest',
- 'language' => $wgContLang,
+ 'language' => MediaWikiServices::getInstance()->getContentLanguage(),
'multilang' => false,
'extmetadatafilter' => [],
'revdelUser' => null,
}
public function getAllowedParams() {
- global $wgContLang;
-
return [
'prop' => [
ApiBase::PARAM_ISMULTI => true,
],
'extmetadatalanguage' => [
ApiBase::PARAM_TYPE => 'string',
- ApiBase::PARAM_DFLT => $wgContLang->getCode(),
+ ApiBase::PARAM_DFLT =>
+ MediaWikiServices::getInstance()->getContentLanguage()->getCode(),
],
'extmetadatamultilang' => [
ApiBase::PARAM_TYPE => 'boolean',