$pref = $parser->getOptions()->getDateFormat();
// Specify a different default date format other than the the normal default
- // iff the user has 'default' for their setting
+ // if the user has 'default' for their setting
if ( $pref == 'default' && $defaultPref ) {
$pref = $defaultPref;
}
// disallow some styles that could be used to bypass $wgRestrictDisplayTitle
if ( $wgRestrictDisplayTitle ) {
- $htmlTagsCallback = function ( $params ) {
+ $htmlTagsCallback = function ( &$params ) {
$decoded = Sanitizer::decodeTagAttributes( $params );
if ( isset( $decoded['style'] ) ) {
return self::formatRaw( SiteStats::edits(), $raw );
}
static function numberofviews( $parser, $raw = null ) {
- return self::formatRaw( SiteStats::views(), $raw );
+ global $wgDisableCounters;
+ return !$wgDisableCounters ? self::formatRaw( SiteStats::views(), $raw ) : '';
}
static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
return self::formatRaw( SiteStats::pagesInNs( intval( $namespace ) ), $raw );
* @return string
*/
static function pagesincategory( $parser, $name = '', $arg1 = null, $arg2 = null ) {
+ global $wgContLang;
static $magicWords = null;
if ( is_null( $magicWords ) ) {
$magicWords = new MagicWordArray( array(
if ( !$title ) { # invalid title
return self::formatRaw( 0, $raw );
}
+ $wgContLang->findVariantLink( $name, $title, true );
// Normalize name for cache
$name = $title->getDBkey();
$page = $title->getPrefixedText();
$length = 0;
- if ( $title->equals( $parser->getTitle() )
- && $parser->mInputSize !== false
- ) {
- # We are on current page (and not in PST), so
- # take length of input to parser.
- $length = $parser->mInputSize;
- } elseif ( isset( $cache[$page] ) ) {
+ if ( isset( $cache[$page] ) ) {
$length = $cache[$page];
} elseif ( $parser->incrementExpensiveFunctionCount() ) {
$rev = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
if ( $old === false || $old == $text || $arg ) {
return '';
} else {
+ $converter = $parser->getConverterLanguage()->getConverter();
return '<span class="error">' .
wfMessage( 'duplicate-defaultsort',
- wfEscapeWikiText( $old ), // Message should be parsed, but these params should only be escaped.
- wfEscapeWikiText( $text )
+ // Message should be parsed, but these params should only be escaped.
+ $converter->markNoConversion( wfEscapeWikiText( $old ) ),
+ $converter->markNoConversion( wfEscapeWikiText( $text ) )
)->inContentLanguage()->text() .
'</span>';
}