Merge pull request #21243 from ATM-Consulting/FIX_verifCond_strpos_on_non_string

FIX: warning / fatal when dol_eval return value is non-empty && non-string
This commit is contained in:
Laurent Destailleur 2022-06-14 18:02:02 +02:00 committed by GitHub
commit 9ec077cccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8505,7 +8505,7 @@ function verifCond($strToEvaluate)
//dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition
//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
$rights = (($rep && strpos($rep, 'Bad string syntax to evaluate') === false) ? true : false);
$rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false);
//var_dump($rights);
}
return $rights;