mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-03 02:48:49 +03:00
BuildHtml() iterates $oElement->attributes -- a live DOMNamedNodeMap -- and calls removeAttribute() on the attribute the foreach is currently on. That ends the iteration: the loop sees no further attribute, so exactly one data-* is removed per element however many it carries. Measured on PHP 8.5.10 / libxml 2.12.5, data-* left behind: <p data-a> -> none <p data-a data-b> -> data-b <p data-a data-b data-c> -> data-b, data-c <p data-a data-b data-c data-d> -> data-b, data-c, data-d <p DATA-A data-b> -> data-b The single call site is buildMessage() in RainLoop/Actions/Messages.php, reached from both DoSaveMessage() and DoSendMessage(), as the docblock on BuildHtml() says. So the attributes that survive go out in the sent message and into the draft that is APPENDed and read back later. It is not the display path: an incoming body is only decoded and charset converted in MailSo\Mail\Message::fromFetchResponse(), and the browser filters it with the allowlists in dev/Common/Html.js. The fix collects the names first, then removes them. |
||
|---|---|---|
| .. | ||
| Enumerations | ||
| StreamFilters | ||
| StreamWrappers | ||
| Collection.php | ||
| DateTimeHelper.php | ||
| HtmlUtils.php | ||
| Http.php | ||
| Locale.php | ||
| ResourceRegistry.php | ||
| Utils.php | ||
| Xxtea.php | ||