Portal: Fix double HTML encoding of fields metadata (label, raw value)

This commit is contained in:
Molkobain
2020-10-20 14:27:18 +02:00
parent 7fa7ebb59c
commit 116c0c0138
2 changed files with 3 additions and 2 deletions

View File

@@ -1029,7 +1029,7 @@ abstract class AttributeDefinition
// Metadata
$oFormField->AddMetadata('attribute-code', $this->GetCode());
$oFormField->AddMetadata('attribute-type', get_class($this));
$oFormField->AddMetadata('attribute-label', utils::HtmlEntities($this->GetLabel()));
$oFormField->AddMetadata('attribute-label', $this->GetLabel());
// - Attribute flags
$aPossibleAttFlags = MetaModel::EnumPossibleAttributeFlags();
foreach($aPossibleAttFlags as $sFlagCode => $iFlagValue)
@@ -1046,7 +1046,7 @@ abstract class AttributeDefinition
// - Value raw
if ($this::IsScalar())
{
$oFormField->AddMetadata('value-raw', utils::HtmlEntities($oObject->Get($this->GetCode())));
$oFormField->AddMetadata('value-raw', $oObject->Get($this->GetCode()));
}
return $oFormField;

View File

@@ -398,6 +398,7 @@ abstract class Field
/**
* Add a metadata to the field. If the metadata $sName already exists, it will be overwritten.
* Note: $sValue should NOT be HTML (or something else) encoded, only the renderer should take care of it.
*
* @param string $sName
* @param string $sValue