X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FTitle.php;h=6c15a062b095dd91f785803bbfc470ae8a5e3bf8;hp=9843e81962ac9296e1faf915690b0f1bb4d856b0;hb=9e8439e79d67788916d488f645108f79016d9aca;hpb=af80076034fb734d652eb043c523c1d8df974e51 diff --git a/includes/Title.php b/includes/Title.php index 9843e81962..6c15a062b0 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2137,7 +2137,7 @@ class Title implements LinkTarget, IDBAccessObject { * @return string String of the URL. */ public function getLocalURL( $query = '', $query2 = false ) { - global $wgArticlePath, $wgScript, $wgServer, $wgRequest; + global $wgArticlePath, $wgScript, $wgServer, $wgRequest, $wgMainPageIsDomainRoot; $query = self::fixUrlQueryArgs( $query, $query2 ); @@ -2214,6 +2214,11 @@ class Title implements LinkTarget, IDBAccessObject { $url = $wgServer . $url; } } + + if ( $wgMainPageIsDomainRoot && $this->isMainPage() && $query === '' ) { + return '/'; + } + // Avoid PHP 7.1 warning from passing $this by reference $titleRef = $this; Hooks::run( 'GetLocalURL', [ &$titleRef, &$url, $query ] );