From 897e91abf93b19124d60931b87ac092d1298e40b Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Mon, 16 May 2016 19:33:05 +0200 Subject: [PATCH] Fixed issue #11195: Expression Manager : bad comparaison with numeric value Dev: set to strval, else real float is invalid --- application/helpers/expressions/em_core_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/helpers/expressions/em_core_helper.php b/application/helpers/expressions/em_core_helper.php index 4e5f90108d0..cfe4c657e14 100644 --- a/application/helpers/expressions/em_core_helper.php +++ b/application/helpers/expressions/em_core_helper.php @@ -273,8 +273,8 @@ private function RDP_EvaluateBinary(array $token) /* Don't return true always : user can entre non numeric value in a numeric value : we must compare as string then */ $arg1[0]=($arg1[2]=="NUMBER" && strpos($arg1[0],".")) ? rtrim(rtrim($arg1[0],"0"),".") : $arg1[0]; $arg2[0]=($arg2[2]=="NUMBER" && strpos($arg2[0],".")) ? rtrim(rtrim($arg2[0],"0"),".") : $arg2[0]; - $bNumericArg1 = $arg1[0]==='' || strval(floatval($arg1[0]))===$arg1[0]; - $bNumericArg2 = $arg2[0]==='' || strval(floatval($arg2[0]))===$arg2[0]; + $bNumericArg1 = $arg1[0]==='' || strval(floatval($arg1[0]))==strval($arg1[0]); + $bNumericArg2 = $arg2[0]==='' || strval(floatval($arg2[0]))===strval($arg2[0]); $bStringArg1 = !$arg1[0] || !$bNumericArg1; $bStringArg2 = !$arg1[0] || !$bNumericArg2;