From: Raimond Spekking Date: Fri, 31 Jul 2009 09:40:11 +0000 (+0000) Subject: * The description message in $wgExtensionCredits can be an array with parameters now X-Git-Tag: 1.31.0-rc.0~40608 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=9b49cea803afb755b570fbfbe05e372dd576bd21;p=lhc%2Fweb%2Fwiklou.git * The description message in $wgExtensionCredits can be an array with parameters now --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d5aeb3778b..bb31d5808a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -171,6 +171,7 @@ this. Was used when mwEmbed was going to be an extension. extension version in Special:Version * (bug 20014) Added CSS class "mw-listgrouprights-right-name" is wrapped on the right name in Special:ListGroupRights +* The description message in $wgExtensionCredits can be an array with parameters === Bug fixes in 1.16 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 14b817faf3..0944a1e66f 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2765,8 +2765,8 @@ $wgDebugJavaScript = false; * * $wgExtensionCredits[$type][] = array( * 'name' => 'Example extension', - * 'version' => 1.9, - * 'path' => __FILE__, + * 'version' => 1.9, + * 'path' => __FILE__, * 'author' => 'Foo Barstein', * 'url' => 'http://wwww.example.com/Example%20Extension/', * 'description' => 'An example extension', @@ -2775,6 +2775,8 @@ $wgDebugJavaScript = false; * * * Where $type is 'specialpage', 'parserhook', 'variable', 'media' or 'other'. + * Where 'descriptionmsg' can be an array with message key and parameters: + * 'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ), */ $wgExtensionCredits = array(); /* diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index ff2d97cc1d..0e4e49fb0b 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -473,7 +473,14 @@ class SpecialVersion extends SpecialPage { # Look for a localized description if( isset( $descriptionMsg ) ) { - $msg = wfMsg( $descriptionMsg ); + if( is_array( $descriptionMsg ) ) { + $descriptionMsgKey = $descriptionMsg[0]; // Get the message key + array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only + array_map( "htmlspecialchars", $descriptionMsg ); // For sanity + $msg = wfMsg( $descriptionMsgKey, $descriptionMsg ); + } else { + $msg = wfMsg( $descriptionMsg ); + } if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) { $description = $msg; }