* The description message in $wgExtensionCredits can be an array with parameters now
authorRaimond Spekking <raymond@users.mediawiki.org>
Fri, 31 Jul 2009 09:40:11 +0000 (09:40 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Fri, 31 Jul 2009 09:40:11 +0000 (09:40 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/specials/SpecialVersion.php

index d5aeb37..bb31d58 100644 (file)
@@ -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 ===
 
index 14b817f..0944a1e 100644 (file)
@@ -2765,8 +2765,8 @@ $wgDebugJavaScript = false;
  * <code>
  * $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;
  * </code>
  *
  * 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();
 /*
index ff2d97c..0e4e49f 100644 (file)
@@ -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;
                        }