X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FCoreParserFunctions.php;h=8917b6d06b2b709e9709285dba2c13eefcedf950;hb=61a5d6e0630de5bca10177d7d8d20637afa0cd40;hp=3a6edd288f9def5c99788a506bed8faa1ba80410;hpb=7ab935b039e67242b8607335b78f4e85c0eaed0d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 3a6edd288f..8917b6d06b 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -342,6 +342,7 @@ class CoreParserFunctions { 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 ); } @@ -660,7 +661,7 @@ class CoreParserFunctions { 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; @@ -747,7 +748,7 @@ class CoreParserFunctions { $title = SpecialPage::getTitleFor( $page, $subpage ); return $title->getPrefixedText(); } else { - return wfMsgForContent( 'nosuchspecialpage' ); + return wfMessage( 'nosuchspecialpage' )->inContentLanguage()->text(); } } @@ -782,9 +783,7 @@ class CoreParserFunctions { return ''; } else { return( '' . - wfMsgForContent( 'duplicate-defaultsort', - htmlspecialchars( $old ), - htmlspecialchars( $text ) ) . + wfMessage( 'duplicate-defaultsort', $old, $text )->inContentLanguage()->escaped() . '' ); } } @@ -793,7 +792,6 @@ class CoreParserFunctions { // 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] }} @@ -845,7 +843,7 @@ class CoreParserFunctions { $stripList = $parser->getStripList(); if ( !in_array( $tagName, $stripList ) ) { return '' . - wfMsgForContent( 'unknown_extension_tag', $tagName ) . + wfMessage( 'unknown_extension_tag', $tagName )->inContentLanguage()->text() . ''; }