diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 7fcdeb0b79a..1da7bc7eb97 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -9242,10 +9242,12 @@ abstract class CommonObject
if (($mode == 'create') && !in_array(abs($visibility), array(1, 3))) {
continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
} elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) {
- // We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
+ // We need to make sure, that the values of hidden extrafields are also part of $_POST.
+ // Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
+ // TODO: We should not have this hidden field, and action='update' should be done only if field was POSTED by form.
$ef_name = 'options_' . $key;
- $ef_value = dol_htmlentities($this->array_options[$ef_name], ENT_QUOTES | ENT_SUBSTITUTE);
- $out .= '' . "\n";
+ $ef_value = $this->array_options[$ef_name];
+ $out .= '' . "\n";
continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
} elseif ($mode == 'view' && empty($visibility)) {
continue;