r54772 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54771‎ | r54772 | r54773 >
Date:07:08, 11 August 2009
Author:raymond
Status:ok
Tags:
Comment:
Recommit r54081 after general revert r54735: The description message in $wgExtensionCredits can be an array with parameters now
This functionality is used by the 'Maps' and 'SemanticMaps' extensions
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -2790,8 +2790,8 @@
27912791 * <code>
27922792 * $wgExtensionCredits[$type][] = array(
27932793 * 'name' => 'Example extension',
2794 - * 'version' => 1.9,
2795 - * 'path' => __FILE__,
 2794+ * 'version' => 1.9,
 2795+ * 'path' => __FILE__,
27962796 * 'author' => 'Foo Barstein',
27972797 * 'url' => 'http://wwww.example.com/Example%20Extension/',
27982798 * 'description' => 'An example extension',
@@ -2800,6 +2800,8 @@
28012801 * </code>
28022802 *
28032803 * Where $type is 'specialpage', 'parserhook', 'variable', 'media' or 'other'.
 2804+ * Where 'descriptionmsg' can be an array with message key and parameters:
 2805+ * 'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ),
28042806 */
28052807 $wgExtensionCredits = array();
28062808 /*
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -259,10 +259,17 @@
260260
261261 # Look for a localized description
262262 if( isset( $descriptionMsg ) ) {
263 - $msg = wfMsg( $descriptionMsg );
264 - if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) {
265 - $description = $msg;
 263+ if( is_array( $descriptionMsg ) ) {
 264+ $descriptionMsgKey = $descriptionMsg[0]; // Get the message key
 265+ array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only
 266+ array_map( "htmlspecialchars", $descriptionMsg ); // For sanity
 267+ $msg = wfMsg( $descriptionMsgKey, $descriptionMsg );
 268+ } else {
 269+ $msg = wfMsg( $descriptionMsg );
266270 }
 271+ if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) {
 272+ $description = $msg;
 273+ }
267274 }
268275
269276 if ( $haveSubversion ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -196,6 +196,7 @@
197197 ** If $wgWellFormedXml is set to false, some bytes will be shaved off of HTML
198198 output by omitting some things like quotation marks where HTML 5 allows.
199199 * Added crop for inline images.
 200+* The description message in $wgExtensionCredits can be an array with parameters
200201
201202 === Bug fixes in 1.16 ===
202203

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r54081* The description message in $wgExtensionCredits can be an array with paramet...raymond09:40, 31 July 2009
r54735Revert Special:Version to known-good state as of r52060, without the ten bill...brion20:15, 10 August 2009

Status & tagging log