From 4bf4ecaf0eec6b4123af259bad5756df026d34af Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Thu, 22 Dec 2022 11:55:24 -0500 Subject: [PATCH] fixes core#4047 - htmlspecialchars called on empty array --- HTML/Common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HTML/Common.php b/HTML/Common.php index 487ca5e22..789d6d867 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;