X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fapi%2FApiQueryLangLinks.php;h=b8c30acbefaa512c678a8d3505c8cd569510da2c;hb=fa0fe8d2940b71950f82f2303acd3a3717b51389;hp=df33d027245fc6d1925bdc112b8f39f7ab788652;hpb=6c9a2923fe1ee3a65cb027be5e781772f2b12fbd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index df33d02724..b8c30acbef 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -24,6 +20,8 @@ * @file */ +use MediaWiki\MediaWikiServices; + /** * A query module to list all langlinks (links to corresponding foreign language pages). * @@ -72,7 +70,7 @@ class ApiQueryLangLinks extends ApiQueryBase { $cont = explode( '|', $params['continue'] ); $this->dieContinueUsageIf( count( $cont ) != 2 ); $op = $params['dir'] == 'descending' ? '<' : '>'; - $llfrom = intval( $cont[0] ); + $llfrom = (int)$cont[0]; $lllang = $this->getDB()->addQuotes( $cont[1] ); $this->addWhere( "ll_from $op $llfrom OR " . @@ -144,7 +142,6 @@ class ApiQueryLangLinks extends ApiQueryBase { } public function getAllowedParams() { - global $wgContLang; return [ 'prop' => [ ApiBase::PARAM_ISMULTI => true, @@ -164,7 +161,7 @@ class ApiQueryLangLinks extends ApiQueryBase { 'descending' ] ], - 'inlanguagecode' => $wgContLang->getCode(), + 'inlanguagecode' => MediaWikiServices::getInstance()->getContentLanguage()->getCode(), 'limit' => [ ApiBase::PARAM_DFLT => 10, ApiBase::PARAM_TYPE => 'limit',