Consistently preserve anchors in the title specified in 'mainpage' message
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 27 Sep 2017 21:41:47 +0000 (23:41 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 27 Sep 2017 21:41:47 +0000 (23:41 +0200)
When 'mainpage' was used in the 'sidebar' message, the anchor would be
preserved (code in Skin::addToSidebarPlain() uses Title::getLinkURL()).

When 'mainpage' was used on its own in Skin::makeMainPageUrl() (which
is used in SkinTemplate::buildNavUrls(), and many skins use that data
to generate the logo link), it would not be preserved (the code used
Title::getLocalURL()).

Bug: T176583
Change-Id: Icc4895c08089caaa06e37ce765819829b90de0ff

includes/skins/Skin.php

index 8fb0d1c..167b49d 100644 (file)
@@ -1095,7 +1095,7 @@ abstract class Skin extends ContextSource {
                $title = Title::newMainPage();
                self::checkTitle( $title, '' );
 
-               return $title->getLocalURL( $urlaction );
+               return $title->getLinkURL( $urlaction );
        }
 
        /**