N°5849 - Fix wrong encoding of external keys in "Header with statstics" dashlet - fix for 3.1

This commit is contained in:
acognet
2023-01-30 17:29:25 +01:00
parent 002e52cc3e
commit e0cc00e772

View File

@@ -1047,11 +1047,11 @@ JS
$aCount = $aCounts[$sStateValue];
$sHyperlink = $aCount['link'];
$sCountLabel = $aCount['label'];
$oPill = PillFactory::MakeForState($sClass, $sStateValue);
// N°5849 - Unencode label for ExternalKey attribute because friendlyname is already html encoded thanks to DBObject::GetName() in AttributeExternalKey::GetAllowedValues(). (A fix in this function may have too much impact).
if ($oAttDef instanceof AttributeExternalKey) {
$sPillTooltip = utils::HtmlEntityDecode($sStateLabel);
$sPillTooltip = htmlspecialchars_decode($sStateLabel, ENT_QUOTES | ENT_DISALLOWED | ENT_HTML5);
$sPillLabel = $sStateLabel;
} else {
$sPillTooltip = $sStateLabel;
@@ -1059,7 +1059,6 @@ JS
}
$oPill->SetTooltip($sPillTooltip)
->AddHtml("<span class=\"ibo-dashlet-header-dynamic--count\">$sCountLabel</span><span class=\"ibo-dashlet-header-dynamic--label ibo-text-truncated-with-ellipsis\">".$sPillLabel."</span>");
if ($sHyperlink != '-') {
$oPill->SetUrl($sHyperlink);
}