r48810 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48809‎ | r48810 | r48811 >
Date:12:27, 25 March 2009
Author:werdna
Status:ok
Tags:
Comment:
Convert formatdate to a hashed parserfunction
Modified paths:
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -7263,18 +7263,18 @@
72647264 !!end
72657265
72667266 !!test
7267 -Formatted unlinked date
 7267+formatdate parser function
72687268 !!input
7269 -{{formatdate:2009-03-24}}
 7269+{{#formatdate:2009-03-24}}
72707270 !! result
72717271 <p><span class="mw-formatted-date" title="2009-03-24">2009-03-24</span>
72727272 </p>
72737273 !! end
72747274
72757275 !!test
7276 -Formatted unlinked date with default format
 7276+formatdate parser function, with default format
72777277 !!input
7278 -{{formatdate:2009-03-24|mdy}}
 7278+{{#formatdate:2009-03-24|mdy}}
72797279 !! result
72807280 <p><span class="mw-formatted-date" title="2009-03-24">March 24, 2009</span>
72817281 </p>
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -67,7 +67,7 @@
6868 $parser->setFunctionHook( 'subjectpagename', array( __CLASS__, 'subjectpagename' ), SFH_NO_HASH );
6969 $parser->setFunctionHook( 'subjectpagenamee', array( __CLASS__, 'subjectpagenamee' ), SFH_NO_HASH );
7070 $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS );
71 - $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ), SFH_NO_HASH );
 71+ $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) );
7272
7373 if ( $wgAllowDisplayTitle ) {
7474 $parser->setFunctionHook( 'displaytitle', array( __CLASS__, 'displaytitle' ), SFH_NO_HASH );

Status & tagging log