diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /includes/WikiMap.php | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'includes/WikiMap.php')
-rw-r--r-- | includes/WikiMap.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/includes/WikiMap.php b/includes/WikiMap.php index b04a7842..da4416de 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; } @@ -211,15 +216,14 @@ class WikiReference { } /** - * Get a URL based on $wgServer, like Title::getFullUrl() would produce + * Get a URL based on $wgServer, like Title::getFullURL() would produce * when called locally on the wiki. * * @param string $page page name (must be normalized before calling this function!) * @return String: URL */ public function getFullUrl( $page ) { - return - $this->mServer . + return $this->mServer . $this->getLocalUrl( $page ); } } |