From: Niklas Laxström Date: Mon, 27 Aug 2012 08:53:42 +0000 (+0000) Subject: Validate number input for {{PLURAL}} X-Git-Tag: 1.31.0-rc.0~22569^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=a42bd6d4bbbb75665320c7c86cd9e3b53c22c144;p=lhc%2Fweb%2Fwiklou.git Validate number input for {{PLURAL}} The new plural parser is pickier about input. Change-Id: I1d033d30fdad61db2f661f603d9866923245137a --- diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 4c6a22f740..72eddd9000 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 ); }