From 70969c83ce0de4f75de756b2c99f962470ac93c4 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 16 Mar 2010 19:47:24 +0000 Subject: [PATCH] * (bug 22772) {{#special:}} parser function now works with subpages --- RELEASE-NOTES | 1 + includes/parser/CoreParserFunctions.php | 7 ++++--- maintenance/parserTests.txt | 10 ++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 515979d8f5..ebcd6fc04f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 8abcc04f40..f31d0b8839 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -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' ); } diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 4dc5732ab8..544b1f69b5 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -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 -- 2.20.1