r63828 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63827‎ | r63828 | r63829 >
Date:19:47, 16 March 2010
Author:ialex
Status:ok
Tags:
Comment:
* (bug 22772) {{#special:}} parser function now works with subpages
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -3167,6 +3167,16 @@
31683168 !! end
31693169
31703170 !! test
 3171+{{#special:}} page name with subpage, known
 3172+!! options
 3173+msg
 3174+!! input
 3175+{{#special:Recentchanges/param}}
 3176+!! result
 3177+Special:RecentChanges/param
 3178+!! end
 3179+
 3180+!! test
31713181 {{#special:}} page name, unknown
31723182 !! options
31733183 msg
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -561,9 +561,10 @@
562562 }
563563
564564 static function special( $parser, $text ) {
565 - $title = SpecialPage::getTitleForAlias( $text );
566 - if ( $title ) {
567 - return $title->getPrefixedText();
 565+ list( $page, $subpage ) = SpecialPage::resolveAliasWithSubpage( $text );
 566+ if ( $page ) {
 567+ $title = SpecialPage::getTitleFor( $page, $subpage );
 568+ return $title;
568569 } else {
569570 return wfMsgForContent( 'nosuchspecialpage' );
570571 }
Index: trunk/phase3/RELEASE-NOTES
@@ -49,6 +49,7 @@
5050 * (bug 22353) Categorised recent changes now works again
5151 * (bug 22747) "Reveal my e-mail address in notification e-mails" preference is
5252 now only displayed when relevant
 53+* (bug 22772) {{#special:}} parser function now works with subpages
5354
5455 == API changes in 1.17 ==
5556 * (bug 22738) Allow filtering by action type on query=logevent

Status & tagging log