X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTitle.php;h=6c15a062b095dd91f785803bbfc470ae8a5e3bf8;hb=3dff713fe40afc79a69631d65d7809bb5206b608;hp=9843e81962ac9296e1faf915690b0f1bb4d856b0;hpb=31f66267ae9763dcecd44c1e749fe0e91b5a3a01;p=lhc%2Fweb%2Fwiklou.git 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 ] );