diff --git a/HTML/Common.php b/HTML/Common.php
index 487ca5e22..b14fb9bff 100644
--- a/HTML/Common.php
+++ b/HTML/Common.php
@@ -141,7 +141,7 @@ function _getAttrString($attributes)
if (is_array($attributes)) {
$charset = HTML_Common::charset();
foreach ($attributes as $key => $value) {
- $strAttr .= ' ' . $key . '="' . htmlspecialchars(($value ?? ''), ENT_COMPAT, $charset) . '"';
+ $strAttr .= ' ' . $key . '="' . htmlspecialchars((is_array($value) ? '' : ($value ?? '')), ENT_COMPAT, $charset) . '"';
}
}
return $strAttr;