* (bug 22772) {{#special:}} parser function now works with subpages

This commit is contained in:
Alexandre Emsenhuber 2010-03-16 19:47:24 +00:00
parent 2e30b0592a
commit 70969c83ce
3 changed files with 15 additions and 3 deletions

View 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

View 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' );
}

View 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