2
0
forked from Wavyzz/dolibarr

FIX dol_eval with function starting with !

This commit is contained in:
Laurent Destailleur
2023-10-18 16:10:53 +02:00
parent 558b6b5762
commit 8abde02b85

View File

@@ -9189,7 +9189,8 @@ function verifCond($strToEvaluate)
$rights = true;
if (isset($strToEvaluate) && $strToEvaluate !== '') {
//var_dump($strToEvaluate);
$rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition
//$rep = dol_eval($strToEvaluate, 1, 0, '1'); // to show the error
$rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition
$rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false);
//var_dump($rights);
}