From 3d959caf9bcab0c363553591b8715d0b5d4ae584 Mon Sep 17 00:00:00 2001 From: Merci Jacob Date: Fri, 20 Dec 2024 17:32:59 +0200 Subject: [PATCH] fix(backend): strip out style attributes from the message text when replying to a message originally in HTML format --- modules/core/message_functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/core/message_functions.php b/modules/core/message_functions.php index 1eaac26d58..6ab2664a0c 100644 --- a/modules/core/message_functions.php +++ b/modules/core/message_functions.php @@ -449,8 +449,7 @@ class HTMLToText { function __construct($html) { $doc = new DOMDocument(); - $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'); - $doc->loadHTML(htmlentities($html, ENT_QUOTES, 'UTF-8')); + $doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); if (trim($html) && $doc->hasChildNodes()) { $this->parse_nodes($doc->childNodes); }