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 77054a2 commit f812d6b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -9,6 +9,8 @@ Some user think ergonomy of LimeSurvey 2.50 is not better than 2.06 version. But


## Improvement and history ##
* 1.0.15
* Fix bad comparaison of Number (again)
* 1.0.14
* Add cssclass attribute : allow to manage more easily any plugins for question
* 1.0.13
Expand Down
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -13,7 +13,7 @@

$config['versionnumber'] = "2.06+ SondagesPro";
$config['dbversionnumber'] = 184;
$config['buildnumber'] = '160510 - 1.0.14';
$config['buildnumber'] = '160510 - 1.0.15';
$config['updatable'] = false;

return $config;
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 enter 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 f812d6b

Please sign in to comment.