Skip to content

Commit

Permalink
fix(backend): strip out style attributes from the message text when r…
Browse files Browse the repository at this point in the history
…eplying to a message originally in HTML format
  • Loading branch information
mercihabam committed Dec 20, 2024
1 parent a8e81d4 commit 3d959ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/core/message_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3d959ca

Please sign in to comment.