Replace Language::factory( $wgLanguageCode ) by $wgContLang
authorFomafix <fomafix@googlemail.com>
Mon, 9 Nov 2015 05:28:58 +0000 (05:28 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Mon, 9 Nov 2015 05:28:58 +0000 (05:28 +0000)
$wgContLang is filled with Language::factory( $wgLanguageCode ) in Setup.php

Change-Id: I2cb222ee793106140755cf109f9fcc5fcbaa4ddd

includes/specials/SpecialLinkSearch.php

index f474867..ca89776 100644 (file)
@@ -68,10 +68,9 @@ class LinkSearchPage extends QueryPage {
         * This allows for dependency injection even though we don't control object creation.
         */
        private function initServices() {
-               global $wgLanguageCode;
+               global $wgContLang;
                if ( !$this->linkRenderer ) {
-                       $lang = Language::factory( $wgLanguageCode );
-                       $titleFormatter = new MediaWikiTitleCodec( $lang, GenderCache::singleton() );
+                       $titleFormatter = new MediaWikiTitleCodec( $wgContLang, GenderCache::singleton() );
                        $this->linkRenderer = new MediaWikiPageLinkRenderer( $titleFormatter );
                }
        }