Fix add a protection against bad param of dol_eval

This commit is contained in:
Laurent Destailleur
2023-03-13 11:15:46 +01:00
parent abfd324301
commit 3300905599

View File

@@ -8634,6 +8634,10 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
}
}
}
if (is_array($s) || $s === 'Array') {
return 'Bad string syntax to evaluate (value is Array) '.var_export($s, true);
}
if (strpos($s, '::') !== false) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;