Convert formatdate to a hashed parserfunction
authorAndrew Garrett <werdna@users.mediawiki.org>
Wed, 25 Mar 2009 12:27:04 +0000 (12:27 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Wed, 25 Mar 2009 12:27:04 +0000 (12:27 +0000)
includes/parser/CoreParserFunctions.php
maintenance/parserTests.txt

index 9d656d2..774e96a 100644 (file)
@@ -67,7 +67,7 @@ class CoreParserFunctions {
                $parser->setFunctionHook( 'subjectpagename',  array( __CLASS__, 'subjectpagename'  ), SFH_NO_HASH );
                $parser->setFunctionHook( 'subjectpagenamee', array( __CLASS__, 'subjectpagenamee' ), SFH_NO_HASH );
                $parser->setFunctionHook( 'tag',              array( __CLASS__, 'tagObj'           ), SFH_OBJECT_ARGS );
-               $parser->setFunctionHook( 'formatdate',           array( __CLASS__, 'formatDate'           ), SFH_NO_HASH );
+               $parser->setFunctionHook( 'formatdate',           array( __CLASS__, 'formatDate'           ) );
 
                if ( $wgAllowDisplayTitle ) {
                        $parser->setFunctionHook( 'displaytitle', array( __CLASS__, 'displaytitle' ), SFH_NO_HASH );
index d1d10fa..1a42700 100644 (file)
@@ -7263,18 +7263,18 @@ wgUseDynamicDates=1
 !!end
 
 !!test
-Formatted unlinked date
+formatdate parser function
 !!input
-{{formatdate:2009-03-24}}
+{{#formatdate:2009-03-24}}
 !! result
 <p><span class="mw-formatted-date" title="2009-03-24">2009-03-24</span>
 </p>
 !! end
 
 !!test
-Formatted unlinked date with default format
+formatdate parser function, with default format
 !!input
-{{formatdate:2009-03-24|mdy}}
+{{#formatdate:2009-03-24|mdy}}
 !! result
 <p><span class="mw-formatted-date" title="2009-03-24">March 24, 2009</span>
 </p>