static function plural( $parser, $text = '' ) {
$forms = array_slice( func_get_args(), 2 );
$text = $parser->getFunctionLang()->parseFormattedNumber( $text );
+ settype( $text, ctype_digit( $text ) ? 'int' : 'float' );
return $parser->getFunctionLang()->convertPlural( $text, $forms );
}
if( isset( $cache[$page] ) ) {
$length = $cache[$page];
} elseif( $parser->incrementExpensiveFunctionCount() ) {
- $rev = Revision::newFromTitle( $title );
+ $rev = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
$id = $rev ? $rev->getPage() : 0;
$length = $cache[$page] = $rev ? $rev->getSize() : 0;
$title = SpecialPage::getTitleFor( $page, $subpage );
return $title->getPrefixedText();
} else {
- return wfMsgForContent( 'nosuchspecialpage' );
+ return wfMessage( 'nosuchspecialpage' )->inContentLanguage()->text();
}
}
return '';
} else {
return( '<span class="error">' .
- wfMsgForContent( 'duplicate-defaultsort',
- htmlspecialchars( $old ),
- htmlspecialchars( $text ) ) .
+ wfMessage( 'duplicate-defaultsort', $old, $text )->inContentLanguage()->escaped() .
'</span>' );
}
}
// or {{filepath|300px}}, {{filepath|200x300px}}, {{filepath|nowiki|200x300px}}, {{filepath|200x300px|nowiki}}
public static function filepath( $parser, $name='', $argA='', $argB='' ) {
$file = wfFindFile( $name );
- $isNowiki = false;
if( $argA == 'nowiki' ) {
// {{filepath: | option [| size] }}
$stripList = $parser->getStripList();
if ( !in_array( $tagName, $stripList ) ) {
return '<span class="error">' .
- wfMsgForContent( 'unknown_extension_tag', $tagName ) .
+ wfMessage( 'unknown_extension_tag', $tagName )->inContentLanguage()->text() .
'</span>';
}