From: Chad Horohoe Date: Thu, 29 Nov 2012 17:06:25 +0000 (-0500) Subject: Add a hook to Special:Version so we can customize the version URL X-Git-Tag: 1.31.0-rc.0~21471^2 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=73451c606b72acbacc45ee0ab72949dedb4e63b7;p=lhc%2Fweb%2Fwiklou.git Add a hook to Special:Version so we can customize the version URL Change-Id: I02fe38c7b13dcfe570e78d28783098fc18756204 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index c81e86af34..0c8780dd28 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2131,6 +2131,10 @@ $form: The SpecialUpload object use this to change the tables headers $extTypes: associative array of extensions types +'SpecialVersionVersionUrl': called when building the URL for Special:Version +$wgVersion: Current $wgVersion for you to use +&$versionUrl: Raw url to link to (eg: release notes) + 'SpecialWatchlistFilters': called after building form options at Watchlist $special: the special page object &$filters: associative array of filter definitions. The keys are the HTML name/URL parameters. diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 7ace5f8de9..0ff5fc913d 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -263,9 +263,13 @@ class SpecialVersion extends SpecialPage { */ private static function getwgVersionLinked() { global $wgVersion; - $versionParts = array(); - preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts ); - return "[https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]} $wgVersion]"; + $versionUrl = ""; + if( wfRunHooks( 'SpecialVersionVersionUrl', array( $wgVersion, &$versionUrl ) ) ) { + $versionParts = array(); + preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts ); + $versionUrl = "https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]}"; + } + return "[$versionUrl $wgVersion]"; } /**