Skip to content

Commit

Permalink
Fixed issue #11195: Expression Manager : bad comparaison with numeric…
Browse files Browse the repository at this point in the history
… value

Dev: set to strval, else real float is invalid
  • Loading branch information
Shnoulle committed May 16, 2016
1 parent e9e664c commit 897e91a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/expressions/em_core_helper.php
Expand Up @@ -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;
Expand Down

0 comments on commit 897e91a

Please sign in to comment.