From ca91b6bbd56e9196e549f74896691d77acf4ebca Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 3 May 2019 16:44:17 -0700 Subject: [PATCH] ArrayHtml - Mitigate crash on HTML comments --- ext/afform/core/CRM/Afform/ArrayHtml.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/afform/core/CRM/Afform/ArrayHtml.php b/ext/afform/core/CRM/Afform/ArrayHtml.php index e30682f6ce..cfd30300d5 100644 --- a/ext/afform/core/CRM/Afform/ArrayHtml.php +++ b/ext/afform/core/CRM/Afform/ArrayHtml.php @@ -112,6 +112,9 @@ class CRM_Afform_ArrayHtml { elseif ($node instanceof DOMText) { return $node->textContent; } + elseif ($node instanceof DOMComment) { + // FIXME: How to preserve comments? For the moment, discarding them. + } else { throw new \RuntimeException("Unrecognized DOM node"); } -- 2.25.1