From: Tim Starling Date: Thu, 16 May 2013 23:12:32 +0000 (+1000) Subject: In $wgConf, allow wgCanonicalServer to be false or absent X-Git-Tag: 1.31.0-rc.0~19275 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=f70c572bf26dbc2af855e9c8980c3b1f93072562;p=lhc%2Fweb%2Fwiklou.git In $wgConf, allow wgCanonicalServer to be false or absent According to the doc comment, $wgCanonicalServer can be false, and this is equivalent to it being set to $wgServer. So don't require it to be set for foreign wikis in $wgConf, just use the same interpretation. This makes it slightly easier to set up CentralAuth test servers. Change-Id: I5eb11669236ed2a71d08f53a1393a3d5e8f5f770 --- diff --git a/includes/WikiMap.php b/includes/WikiMap.php index 5d90b127c2..da4416de31 100644 --- a/includes/WikiMap.php +++ b/includes/WikiMap.php @@ -40,10 +40,15 @@ class WikiMap { if ( $major === null ) { return null; } - $canonicalServer = $wgConf->get( 'wgCanonicalServer', $wikiID, $major, - array( 'lang' => $minor, 'site' => $major ) ); $server = $wgConf->get( 'wgServer', $wikiID, $major, array( 'lang' => $minor, 'site' => $major ) ); + + $canonicalServer = $wgConf->get( 'wgCanonicalServer', $wikiID, $major, + array( 'lang' => $minor, 'site' => $major ) ); + if ( $canonicalServer === false || $canonicalServer === null ) { + $canonicalServer = $server; + } + $path = $wgConf->get( 'wgArticlePath', $wikiID, $major, array( 'lang' => $minor, 'site' => $major ) ); return new WikiReference( $major, $minor, $canonicalServer, $path, $server );