From a42bd6d4bbbb75665320c7c86cd9e3b53c22c144 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 27 Aug 2012 08:53:42 +0000 Subject: [PATCH] Validate number input for {{PLURAL}} The new plural parser is pickier about input. Change-Id: I1d033d30fdad61db2f661f603d9866923245137a --- includes/parser/CoreParserFunctions.php | 1 + 1 file changed, 1 insertion(+) 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 ); } -- 2.20.1