X-Git-Url: http://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2FWikiMap.php;h=da4416de31d73e757da357b7c3135c3e1a215ac4;hb=2d56adb39328ac086bed031bc47b1c1448ee1db5;hp=a1dbbfc098ca080672fe4f9356a7578d34457998;hpb=cfcbb5e3badb2d8867170e564b1467a229a13434;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WikiMap.php b/includes/WikiMap.php index a1dbbfc098..da4416de31 100644 --- a/includes/WikiMap.php +++ b/includes/WikiMap.php @@ -37,13 +37,18 @@ class WikiMap { $wgConf->loadFullData(); list( $major, $minor ) = $wgConf->siteFromDB( $wikiID ); - if( $major === null ) { + 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 ); @@ -73,7 +78,7 @@ class WikiMap { * @param string $text link's text; optional, default to "User:$user" * @return String: HTML link or false if the wiki was not found */ - public static function foreignUserLink( $wikiID, $user, $text=null ) { + public static function foreignUserLink( $wikiID, $user, $text = null ) { return self::makeForeignLink( $wikiID, "User:$user", $text ); } @@ -85,7 +90,7 @@ class WikiMap { * @param string $text link's text; optional, default to $page * @return String: HTML link or false if the wiki was not found */ - public static function makeForeignLink( $wikiID, $page, $text=null ) { + public static function makeForeignLink( $wikiID, $page, $text = null ) { if ( !$text ) { $text = $page; }