2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2024-10-13 20:32:52 +02:00
5 changed files with 34 additions and 179 deletions

View File

@@ -10589,27 +10589,15 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1'
//print $s."<br>\n";
if ($returnvalue) {
if ($hideerrors) {
ob_start(); // An evaluation has no reason to output data
$isObBufferActive = true;
$tmps = @eval('return '.$s.';');
$tmpo = ob_get_clean();
$isObBufferActive = false;
if ($tmpo) {
print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: '.$s;
}
return $tmps;
} else {
ob_start(); // An evaluation has no reason to output data
$isObBufferActive = true;
$tmps = eval('return '.$s.';');
$tmpo = ob_get_clean();
$isObBufferActive = false;
if ($tmpo) {
print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: '.$s;
}
return $tmps;
ob_start(); // An evaluation has no reason to output data
$isObBufferActive = true;
$tmps = $hideerrors ? @eval('return ' . $s . ';') : eval('return ' . $s . ';');
$tmpo = ob_get_clean();
$isObBufferActive = false;
if ($tmpo) {
print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: ' . $s;
}
return $tmps;
} else {
dol_syslog('Do not use anymore dol_eval with param returnvalue=0', LOG_WARNING);
if ($hideerrors) {