FIX allow double colon and string obfuscation in dol eval for computed extra fields #34015
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FIX allow double colon and string obfuscation in dol eval for computed extra fields
To reproduce
dol_include_once('/MODULE/class/tools.class.php')?Tools::calculateWeight($object,isset($obj)?$obj:$objp):'Error'
Then when you want to update a field of the object card, you got an error on computed field because you got a bad value containing the error in a string : "Bad string syntax to evaluate (double : char is forbidden) ..."
Backport
The is a backport to allow to concat several point without decimal values in computed extra-field. The const "MAIN_DISALLOW_STRING_OBFUSCATION_IN_DOL_EVAL" was added in commit 3edadbd
Add a const
A const "MAIN_DISALLOW_DOUBLE_COLON_IN_DOL_EVAL" was added here, in order to allow call of static methods.
Otherwise you got an error when you want to update a field on object card.
I don't if it's the good way to by pass this check : e5fd841