From: Reedy Date: Mon, 23 Jul 2012 18:48:23 +0000 (+0100) Subject: Link $wgVersion on Special:Version to Release Notes X-Git-Tag: 1.31.0-rc.0~21767^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=3945a69b0c4429465c5e35f441888209048f89af;p=lhc%2Fweb%2Fwiklou.git Link $wgVersion on Special:Version to Release Notes Change-Id: I38cbde2f02477e4d5e61892cf7575ff1c122149d --- diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index e0c6d12e90..84107def06 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -236,7 +236,7 @@ class SpecialVersion extends SpecialPage { * @return string wgVersion + a link to subversion revision of svn BASE */ private static function getVersionLinkedSvn() { - global $wgVersion, $IP; + global $IP; $info = self::getSvnInfo( $IP ); if( !isset( $info['checkout-rev'] ) ) { @@ -250,19 +250,29 @@ class SpecialVersion extends SpecialPage { )->text(); if ( isset( $info['viewvc-url'] ) ) { - $version = "$wgVersion [{$info['viewvc-url']} $linkText]"; + $version = "[{$info['viewvc-url']} $linkText]"; } else { - $version = "$wgVersion $linkText"; + $version = $linkText; } - return $version; + return self::getwgVersionLinked() . " $version"; + } + + /** + * @return string + */ + private static function getwgVersionLinked() { + global $wgVersion; + $versionParts = array(); + preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts ); + return "[https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]} $wgVersion]"; } /** * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars. False on failure */ private static function getVersionLinkedGit() { - global $wgVersion, $IP; + global $IP; $gitInfo = new GitInfo( $IP ); $headSHA1 = $gitInfo->getHeadSHA1(); @@ -275,7 +285,7 @@ class SpecialVersion extends SpecialPage { if ( $viewerUrl !== false ) { $shortSHA1 = "[$viewerUrl $shortSHA1]"; } - return "$wgVersion $shortSHA1"; + return self::getwgVersionLinked() . " $shortSHA1"; } /**