Sheernox
New Member
Env: ClientExec 7.2.2 (ionCube), PHP 8.5.10, MariaDB 11.8.9
Where:
Bug: When an email has only an HTML body, the parser removes the tags but keeps the text of the style element. The whole style sheet is saved into
Repro:
Fix: Drop style and script elements with their content before removing tags, then collapse runs of blank lines.
Where:
library/CE/EmailParser.php (encoded, so no line is cited), the HTML cleanup behind getMessageBug: When an email has only an HTML body, the parser removes the tags but keeps the text of the style element. The whole style sheet is saved into
troubleticket_log.message as ordinary text, above what the sender wrote. Staff and the client see pages of CSS, and the original HTML is not kept anywhere. Each removed tag also leaves its line break and indentation behind, so an email built from layout tables becomes mostly blank lines. Marketing and automated mail is hit most, because it carries large style sheets and nested tables.Repro:
- Send a support address an email that has only an HTML body, with a style element in its head holding a rule such as body { color: #000; } and a paragraph reading Visible text.
- Open the ticket that is created.
- The message shows the CSS rule before Visible text, with blank lines around them. A body of nested tables adds a blank line for each empty tag.
Fix: Drop style and script elements with their content before removing tags, then collapse runs of blank lines.