* (bug 22772) {{#special:}} parser function now works with subpages
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 16 Mar 2010 19:47:24 +0000 (19:47 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 16 Mar 2010 19:47:24 +0000 (19:47 +0000)
RELEASE-NOTES
includes/parser/CoreParserFunctions.php
maintenance/parserTests.txt

index 515979d..ebcd6fc 100644 (file)
@@ -49,6 +49,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 22353) Categorised recent changes now works again
 * (bug 22747) "Reveal my e-mail address in notification e-mails" preference is
   now only displayed when relevant
+* (bug 22772) {{#special:}} parser function now works with subpages
 
 == API changes in 1.17 ==
 * (bug 22738) Allow filtering by action type on query=logevent
index 8abcc04..f31d0b8 100644 (file)
@@ -561,9 +561,10 @@ class CoreParserFunctions {
        }
 
        static function special( $parser, $text ) {
-               $title = SpecialPage::getTitleForAlias( $text );
-               if ( $title ) {
-                       return $title->getPrefixedText();
+               list( $page, $subpage ) = SpecialPage::resolveAliasWithSubpage( $text );
+               if ( $page ) {
+                       $title = SpecialPage::getTitleFor( $page, $subpage );
+                       return $title;
                } else {
                        return wfMsgForContent( 'nosuchspecialpage' );
                }
index 4dc5732..544b1f6 100644 (file)
@@ -3166,6 +3166,16 @@ msg
 Special:RecentChanges
 !! end
 
+!! test
+{{#special:}} page name with subpage, known
+!! options
+msg
+!! input
+{{#special:Recentchanges/param}}
+!! result
+Special:RecentChanges/param
+!! end
+
 !! test
 {{#special:}} page name, unknown
 !! options