From 3978bd7c05b4d862620c02cd9546c29e3377331b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 12 Jun 2018 20:32:19 -0700 Subject: [PATCH] ArrayHtml - Improve comments and warnings --- ext/afform/CRM/Afform/ArrayHtml.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/afform/CRM/Afform/ArrayHtml.php b/ext/afform/CRM/Afform/ArrayHtml.php index c6dd28e8c5..fa9089a66d 100644 --- a/ext/afform/CRM/Afform/ArrayHtml.php +++ b/ext/afform/CRM/Afform/ArrayHtml.php @@ -35,6 +35,11 @@ class CRM_Afform_ArrayHtml { elseif (is_array($attrValue) && $this->allowStructuredAttribute($tag, $attrName)) { $buf .= sprintf(' %s="%s"', $attrName, htmlentities(json_encode($attrValue))); // FIXME attribute encoding } + else { + Civi::log()->warning('Afform: Cannot serialize attribute {attrName}', [ + 'attrName' => $attrName, + ]); + } } $buf .= '>'; @@ -61,7 +66,7 @@ class CRM_Afform_ArrayHtml { $doc = new DOMDocument(); $doc->loadHTML("$html"); - // FIXME: Valid expected number of child nodes + // FIXME: Validate expected number of child nodes foreach ($doc->childNodes as $htmlNode) { if ($htmlNode instanceof DOMElement && $htmlNode->tagName === 'html') { -- 2.25.1