From 134aa9271259acac3fb6659041f3bbe4123c8c0f Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 4 Jun 2021 11:19:11 +0200 Subject: [PATCH] Clear xml errors in buffer after using xml in Mail otherwise it may get caught wrongly further in etemplate widget --- api/src/Mail/Html.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/Mail/Html.php b/api/src/Mail/Html.php index ee582a620d..9f134cdd89 100644 --- a/api/src/Mail/Html.php +++ b/api/src/Mail/Html.php @@ -500,9 +500,12 @@ class Html LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD | LIBXML_NOBLANKS )) { + // do not sent possible xml errors in buffer further otherwise it may get caught as et2 template error in Widget + libxml_clear_errors(); // Failed to parse return $html; } + $dom->normalizeDocument(); foreach(array('ol','ul') as $list_type) @@ -531,6 +534,9 @@ class Html } $dom->removeChild($dom->firstChild); + // do not sent possible xml errors in buffer further otherwise it may get caught as et2 template error in Widget + libxml_clear_errors(); + return $dom->saveHTML(); }