diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 90627f03409..615a33e4312 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -286,6 +286,17 @@ function getDolGlobalBool($key, $default = false) return (bool) ($conf->global->$key ?? $default); } +/** + * Return the main currency ('EUR', 'USD', ...) + * + * @return string Value returned + */ +function getDolCurrency() +{ + global $conf; + return (string) $conf->currency; +} + /** * Return Dolibarr user constant string value * @@ -11803,8 +11814,9 @@ function dol_eval_new($s) function dol_eval_standard($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1') { // Only this global variables can be read by eval function and returned to caller - global $conf; // Read of const is done with getDolGlobalString() but we need $conf->currency for example - global $db, $langs, $user, $website, $websitepage; + //global $conf; // Disabled. Read of const is done with getDolGlobalString() and read of $conf->currency is done with getDolCurrency() + global $db; + global $langs, $user, $website, $websitepage; global $action, $mainmenu, $leftmenu; global $mysoc; global $objectoffield; // To allow the use of $objectoffield in computed fields