Fix warning

This commit is contained in:
ldestailleur
2025-04-01 13:40:36 +02:00
parent cc8c7b8329
commit b3cbf93c5b

View File

@@ -10851,12 +10851,16 @@ function verifCond($strToEvaluate, $onlysimplestring = '1')
* @param string $onlysimplestring '0' (deprecated, do not use it anymore)=Accept all chars,
* '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';',
* '2' (used for example for the compute property of extrafields)=Accept also '<[]'
* @return void|string Nothing or return result of eval (even if type can be int, it is safer to assume string and find all potential typing issues as abs(dol_eval(...)).
* @return string Return result of eval (even if type can be int, it is safer to assume string and find all potential typing issues as abs(dol_eval(...)).
* @see verifCond(), checkPHPCode() to see sanitizing rules that should be very close.
* @phan-suppress PhanPluginUnsafeEval
*/
function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1')
{
if ($returnvalue != 1) {
dol_syslog("Use of dol_eval with parameter returnvalue = 0 is now forbidden. Please fix this", LOG_ERR);
}
if (getDolGlobalString("MAIN_USE_DOL_EVAL_NEW")) {
return dol_eval_new($s);
} else {