* Avoid duplicate revision imports with Special:Import
* (bug 7054) Validate email address before sending email confirmation message
* (bug 7061) Format title on "from (page)" links on Special:Allpages
+* (bug 7044) Introduce "padleft" and "padright" colon functions
== Languages updated ==
*/
class CoreParserFunctions {
+
static function ns( $parser, $part1 = '' ) {
global $wgContLang;
$found = false;
$lang = $wgContLang->getLanguageName( strtolower( $arg ) );
return $lang != '' ? $lang : $arg;
}
+
+ function padleft( $parser, $string, $length, $char = 0 ) {
+ return str_pad( $string, $length, (string)$char, STR_PAD_LEFT );
+ }
+
+ function padright( $parser, $string, $length, $char = 0 ) {
+ return str_pad( $string, $length, (string)$char, STR_PAD_RIGHT );
+ }
+
}
?>
$this->setFunctionHook( 'numberoffiles', array( 'CoreParserFunctions', 'numberoffiles' ), SFH_NO_HASH );
$this->setFunctionHook( 'numberofadmins', array( 'CoreParserFunctions', 'numberofadmins' ), SFH_NO_HASH );
$this->setFunctionHook( 'language', array( 'CoreParserFunctions', 'language' ), SFH_NO_HASH );
+ $this->setFunctionHook( 'padleft', array( 'CoreParserFunctions', 'padleft' ), SFH_NO_HASH );
+ $this->setFunctionHook( 'padright', array( 'CoreParserFunctions', 'padright' ), SFH_NO_HASH );
if ( $wgAllowDisplayTitle ) {
$this->setFunctionHook( 'displaytitle', array( 'CoreParserFunctions', 'displaytitle' ), SFH_NO_HASH );
'pagesinnamespace' => array( 1, 'PAGESINNAMESPACE:', 'PAGESINNS:' ),
'numberofadmins' => array( 1, 'NUMBEROFADMINS' ),
'formatnum' => array( 0, 'FORMATNUM' ),
+ 'padleft' => array( 0, 'PADLEFT' ),
+ 'padright' => array( 0, 'PADRIGHT' ),
);