From 14c8b4b826e31eac59299aaafea8bfbaa4dc1b65 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Jul 2022 12:51:58 +0200 Subject: [PATCH] FIX doleval with @ --- htdocs/core/lib/functions.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bad0466186a..77ab8eab79a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8585,7 +8585,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 { @@ -9006,6 +9007,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]) {