* (bug 35649) Special:Version now shows hashes of extensions checked out from git.
* (bug 35728) Git revisions are now linked on Special:Version.
* "Show Changes" on default messages shows now diff against default message text
+* (bug 23006) create #speciale parser function.
=== Bug fixes in 1.20 ===
* (bug 30245) Use the correct way to construct a log page title.
$parser->setFunctionHook( 'padright', array( __CLASS__, 'padright' ), SFH_NO_HASH );
$parser->setFunctionHook( 'anchorencode', array( __CLASS__, 'anchorencode' ), SFH_NO_HASH );
$parser->setFunctionHook( 'special', array( __CLASS__, 'special' ) );
+ $parser->setFunctionHook( 'speciale', array( __CLASS__, 'speciale' ) );
$parser->setFunctionHook( 'defaultsort', array( __CLASS__, 'defaultsort' ), SFH_NO_HASH );
$parser->setFunctionHook( 'filepath', array( __CLASS__, 'filepath' ), SFH_NO_HASH );
$parser->setFunctionHook( 'pagesincategory', array( __CLASS__, 'pagesincategory' ), SFH_NO_HASH );
list( $page, $subpage ) = SpecialPageFactory::resolveAlias( $text );
if ( $page ) {
$title = SpecialPage::getTitleFor( $page, $subpage );
- return $title;
+ return $title->getPrefixedText();
} else {
return wfMsgForContent( 'nosuchspecialpage' );
}
}
+ static function speciale( $parser, $text ) {
+ return wfUrlencode( str_replace( ' ', '_', self::special( $parser, $text ) ) );
+ }
+
/**
* @param $parser Parser
* @param $text String The sortkey to use
'padleft' => array( 0, 'PADLEFT' ),
'padright' => array( 0, 'PADRIGHT' ),
'special' => array( 0, 'special', ),
+ 'speciale' => array( 0, 'speciale', ),
'defaultsort' => array( 1, 'DEFAULTSORT:', 'DEFAULTSORTKEY:', 'DEFAULTCATEGORYSORT:' ),
'filepath' => array( 0, 'FILEPATH:' ),
'tag' => array( 0, 'tag' ),
No such special page
!! end
+!! test
+{{#speciale:}} page name, known
+!! options
+msg
+!! input
+{{#speciale:Recentchanges}}
+!! result
+Special:RecentChanges
+!! end
+
+!! test
+{{#speciale:}} page name with subpage, known
+!! options
+msg
+!! input
+{{#speciale:Recentchanges/param}}
+!! result
+Special:RecentChanges/param
+!! end
+
+!! test
+{{#speciale:}} page name, unknown
+!! options
+msg
+!! input
+{{#speciale:foobarnonexistent}}
+!! result
+No_such_special_page
+!! end
+
###
### Images
###