Merge "Optimize TitleFormatter::getPrefixedText() to Title performance"
[lhc/web/wiklou.git] / includes / skins / Skin.php
index 83d02a0..c603f2f 100644 (file)
@@ -449,7 +449,8 @@ abstract class Skin extends ContextSource {
                if ( $title->isSpecialPage() ) {
                        $type = 'ns-special';
                        // T25315: provide a class based on the canonical special page name without subpages
-                       list( $canonicalName ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
+                       list( $canonicalName ) = MediaWikiServices::getInstance()->getSpecialPageFactory()->
+                               resolveAlias( $title->getDBkey() );
                        if ( $canonicalName ) {
                                $type .= ' ' . Sanitizer::escapeClass( "mw-special-$canonicalName" );
                        } else {
@@ -1471,7 +1472,7 @@ abstract class Skin extends ContextSource {
                                $uTalkTitle,
                                $this->msg( 'newmessageslinkplural' )->params( $plural )->escaped(),
                                [],
-                               [ 'redirect' => 'no' ]
+                               $uTalkTitle->isRedirect() ? [ 'redirect' => 'no' ] : []
                        );
 
                        $newMessagesDiffLink = Linker::linkKnown(
@@ -1547,7 +1548,8 @@ abstract class Skin extends ContextSource {
                        $notice = $msg->plain();
                }
 
-               $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+               $services = MediaWikiServices::getInstance();
+               $cache = $services->getMainWANObjectCache();
                $parsed = $cache->getWithSetCallback(
                        // Use the extra hash appender to let eg SSL variants separately cache
                        // Key is verified with md5 hash of unparsed wikitext
@@ -1559,7 +1561,7 @@ abstract class Skin extends ContextSource {
                        }
                );
 
-               $contLang = MediaWikiServices::getInstance()->getContentLanguage();
+               $contLang = $services->getContentLanguage();
                return Html::rawElement(
                        'div',
                        [