Skip to content

Commit 4878c8e

Browse files
authored
Update functions.lib.php
1 parent cb5399a commit 4878c8e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

htdocs/core/lib/functions.lib.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9285,15 +9285,12 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
92859285
return 'Bad string syntax to evaluate (value is Array) '.var_export($s, true);
92869286
}
92879287

9288-
// Disallow double colon
9289-
if (getDolGlobalString('MAIN_DISALLOW_DOUBLE_COLON_IN_DOL_EVAL')) {
9290-
if (strpos($s, '::') !== false) {
9291-
if ($returnvalue) {
9292-
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
9293-
} else {
9294-
dol_syslog('Bad string syntax to evaluate (double : char is forbidden): '.$s);
9295-
return '';
9296-
}
9288+
if (!getDolGlobalString('MAIN_ALLOW_DOUBLE_COLON_IN_DOL_EVAL') && strpos($s, '::') !== false) {
9289+
if ($returnvalue) {
9290+
return 'Bad string syntax to evaluate (double : char is forbidden without setting MAIN_ALLOW_DOUBLE_COLON_IN_DOL_EVAL): '.$s;
9291+
} else {
9292+
dol_syslog('Bad string syntax to evaluate (double : char is forbidden without setting MAIN_ALLOW_DOUBLE_COLON_IN_DOL_EVAL): '.$s, LOG_WARNING);
9293+
return '';
92979294
}
92989295
}
92999296

0 commit comments

Comments
 (0)