diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php
index 42b86433e0..b58320a7ec 100644
--- a/application/displayblock.class.inc.php
+++ b/application/displayblock.class.inc.php
@@ -1047,9 +1047,19 @@ JS
$aCount = $aCounts[$sStateValue];
$sHyperlink = $aCount['link'];
$sCountLabel = $aCount['label'];
- $oPill = PillFactory::MakeForState($sClass, $sStateValue)
- ->SetTooltip($sStateLabel)
- ->AddHtml("");
+
+ $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);
+ $sPillLabel = $sStateLabel;
+ } else {
+ $sPillTooltip = $sStateLabel;
+ $sPillLabel = utils::HtmlEntities($sStateLabel);
+ }
+ $oPill->SetTooltip($sPillTooltip)
+ ->AddHtml("");
+
if ($sHyperlink != '-') {
$oPill->SetUrl($sHyperlink);
}