FIX doleval with @

This commit is contained in:
Laurent Destailleur
2022-07-21 12:51:58 +02:00
parent e9bed0bd31
commit 1f25452d65

View File

@@ -8599,7 +8599,8 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
if ($onlysimplestring == '1') {
// We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL'
// We must accept: '$conf->barcode->enabled && preg_match(\'/^(AAA|BBB)/\',$leftmenu)'
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/', '/').']/i', $s)) {
// We must accept: '$user->rights->cabinetmed->read && $object->canvas=="patient@cabinetmed"'
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
} else {
@@ -9020,6 +9021,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
if ($values[0] != $type) {
continue;
}
//var_dump(verifCond($values[4]));
if (verifCond($values[4])) {
if ($values[3]) {