From 311490e0483c8ea229e0fd32e6a31d3e83f42db8 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Tue, 12 Dec 2023 13:36:52 -0500 Subject: [PATCH] avoid errors in stricter environments --- ext/afform/core/CRM/Afform/ArrayHtml.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/afform/core/CRM/Afform/ArrayHtml.php b/ext/afform/core/CRM/Afform/ArrayHtml.php index 307e16b098..6c942b2ecc 100644 --- a/ext/afform/core/CRM/Afform/ArrayHtml.php +++ b/ext/afform/core/CRM/Afform/ArrayHtml.php @@ -199,7 +199,12 @@ class CRM_Afform_ArrayHtml { $doc = new DOMDocument(); $doc->preserveWhiteSpace = !$this->formatWhitespace; - @$doc->loadHTML("$html"); + // Angular/js isn't fussy about arbitrary tags but libxml is for html data, so ignore errors. + // See also Civi\Afform\Symbols::scan() + $oldErrorStatus = libxml_use_internal_errors(TRUE); + $doc->loadHTML("$html"); + libxml_clear_errors(); + libxml_use_internal_errors($oldErrorStatus); // FIXME: Validate expected number of child nodes -- 2.25.1