X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPageSet.php;h=194a511061b71d7533ea864c07ee4d3f10febf54;hb=b9333ae6557b86e4b074025c43e77e745610b345;hp=19629dae09ef67efdeb3814f284890bdd0b03958;hpb=7bf08b18758e314e725f9bf3855164595d257eb2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index 19629dae09..194a511061 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -418,19 +418,6 @@ class ApiPageSet extends ApiBase { return $this->mGoodTitles + $this->mMissingTitles; } - /** - * Titles that were deemed invalid by Title::newFromText() - * The array's index will be unique and negative for each item - * @deprecated since 1.26, use self::getInvalidTitlesAndReasons() - * @return string[] Array of strings (not Title objects) - */ - public function getInvalidTitles() { - wfDeprecated( __METHOD__, '1.26' ); - return array_map( function ( $t ) { - return $t['title']; - }, $this->mInvalidTitles ); - } - /** * Titles that were deemed invalid by Title::newFromText() * The array's index will be unique and negative for each item @@ -1170,6 +1157,8 @@ class ApiPageSet extends ApiBase { private function processTitlesArray( $titles ) { $usernames = []; $linkBatch = new LinkBatch(); + $services = MediaWikiServices::getInstance(); + $contLang = $services->getContentLanguage(); foreach ( $titles as $title ) { if ( is_string( $title ) ) { @@ -1197,7 +1186,6 @@ class ApiPageSet extends ApiBase { $this->mInterwikiTitles[$unconvertedTitle] = $titleObj->getInterwiki(); } else { // Variants checking - $contLang = MediaWikiServices::getInstance()->getContentLanguage(); if ( $this->mConvertTitles && $contLang->hasVariants() && !$titleObj->exists() ) { @@ -1217,7 +1205,8 @@ class ApiPageSet extends ApiBase { $this->mAllSpecials[$ns][$dbkey] = $this->mFakePageId; $target = null; if ( $ns === NS_SPECIAL && $this->mResolveRedirects ) { - $special = SpecialPageFactory::getPage( $dbkey ); + $spFactory = $services->getSpecialPageFactory(); + $special = $spFactory->getPage( $dbkey ); if ( $special instanceof RedirectSpecialArticle ) { // Only RedirectSpecialArticle is intended to redirect to an article, other kinds of // RedirectSpecialPage are probably applying weird URL parameters we don't want to handle. @@ -1225,7 +1214,7 @@ class ApiPageSet extends ApiBase { $context->setTitle( $titleObj ); $context->setRequest( new FauxRequest ); $special->setContext( $context ); - list( /* $alias */, $subpage ) = SpecialPageFactory::resolveAlias( $dbkey ); + list( /* $alias */, $subpage ) = $spFactory->resolveAlias( $dbkey ); $target = $special->getRedirect( $subpage ); } } @@ -1263,7 +1252,7 @@ class ApiPageSet extends ApiBase { } } // Get gender information - $genderCache = MediaWikiServices::getInstance()->getGenderCache(); + $genderCache = $services->getGenderCache(); $genderCache->doQuery( $usernames, __METHOD__ ); return $linkBatch; @@ -1400,7 +1389,7 @@ class ApiPageSet extends ApiBase { if ( isset( $data[$toPageId] ) && isset( $this->mGeneratorData[$fromNs][$fromDBkey] ) ) { - // It is necesary to set both $data and add to $result, if an ApiResult, + // It is necessary to set both $data and add to $result, if an ApiResult, // to ensure multiple redirects to the same destination are all merged. $data[$toPageId] = call_user_func( $this->mRedirectMergePolicy,