Recommit r54081 after general revert r54735: The description message in $wgExtensionC...
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 11 Aug 2009 07:08:08 +0000 (07:08 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 11 Aug 2009 07:08:08 +0000 (07:08 +0000)
This functionality is used by the 'Maps' and 'SemanticMaps' extensions

RELEASE-NOTES
includes/DefaultSettings.php
includes/specials/SpecialVersion.php

index 7cc621f..ceb45bd 100644 (file)
@@ -196,6 +196,7 @@ this. Was used when mwEmbed was going to be an extension.
 ** If $wgWellFormedXml is set to false, some bytes will be shaved off of HTML
    output by omitting some things like quotation marks where HTML 5 allows.
 * Added crop for inline images.
+* The description message in $wgExtensionCredits can be an array with parameters
 
 === Bug fixes in 1.16 ===
 
index f799f60..440bd41 100644 (file)
@@ -2790,8 +2790,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',
@@ -2800,6 +2800,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 62cbac8..afbe0fb 100644 (file)
@@ -259,10 +259,17 @@ class SpecialVersion extends SpecialPage {
 
                # Look for a localized description
                if( isset( $descriptionMsg ) ) {
-                       $msg = wfMsg( $descriptionMsg );
-                       if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) {
-                               $description = $msg;
+                       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;
+                       }
                }
 
                if ( $haveSubversion ) {