r54220 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54219‎ | r54220 | r54221 >
Date:18:16, 2 August 2009
Author:churchofemacs
Status:ok
Tags:
Comment:
introducing new CoreParserFunction nse as an url-friendly equivalent to ns. bug 12920
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -16,6 +16,7 @@
1717
1818 $parser->setFunctionHook( 'int', array( __CLASS__, 'intFunction' ), SFH_NO_HASH );
1919 $parser->setFunctionHook( 'ns', array( __CLASS__, 'ns' ), SFH_NO_HASH );
 20+ $parser->setFunctionHook( 'nse', array( __CLASS__, 'nse' ), SFH_NO_HASH );
2021 $parser->setFunctionHook( 'urlencode', array( __CLASS__, 'urlencode' ), SFH_NO_HASH );
2122 $parser->setFunctionHook( 'lcfirst', array( __CLASS__, 'lcfirst' ), SFH_NO_HASH );
2223 $parser->setFunctionHook( 'ucfirst', array( __CLASS__, 'ucfirst' ), SFH_NO_HASH );
@@ -118,6 +119,10 @@
119120 return array( 'found' => false );
120121 }
121122 }
 123+
 124+ static function nse( $parser, $part1 = '' ) {
 125+ return wfUrlencode( str_replace( ' ', '_', self::ns( $parser, $part1 ) ) );
 126+ }
122127
123128 static function urlencode( $parser, $s = '' ) {
124129 return urlencode( $s );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -291,6 +291,7 @@
292292 'int' => array( 0, 'INT:' ),
293293 'sitename' => array( 1, 'SITENAME' ),
294294 'ns' => array( 0, 'NS:' ),
 295+ 'nse' => array( 0, 'NSE:' ),
295296 'localurl' => array( 0, 'LOCALURL:' ),
296297 'localurle' => array( 0, 'LOCALURLE:' ),
297298 'server' => array( 0, 'SERVER' ),
Index: trunk/phase3/RELEASE-NOTES
@@ -174,6 +174,8 @@
175175 * (bug 20014) Added CSS class "mw-listgrouprights-right-name" is wrapped on the
176176 right name in Special:ListGroupRights
177177 * The description message in $wgExtensionCredits can be an array with parameters
 178+* (bug 12920) New CoreParserFunction {{nse:...}} as an url-friendly equivalent
 179+ to {{ns:...}}
178180
179181 === Bug fixes in 1.16 ===
180182
@@ -366,7 +368,6 @@
367369 * (bug 17395) Remote file descriptions use user language ($wgLang), not wiki
368370 language ($wgContLang)
369371
370 -
371372 == API changes in 1.16 ==
372373
373374 * Added uiprop=changeablegroups to meta=userinfo

Status & tagging log