Extracted from a patch by @rivimey in the parent issue:
- In function mimeMailRfcHeaders, note that headers are required by the RFCs to end in CRLF - that sequence is not optional and should not be subject to a 'setting'. However inserting CR or CRLF as line ending here results in them being replaced by HTML entity in the DOM code
- In function mimeMailRfcHeaders, rework the wrapping code so it takes notice of the length of the key and avoids "magic numbers" like "20" and "60"; introduce named constant for max line length.
These fixes are in the patch at https://www.drupal.org/files/issues/2019-11-28/mimemail.patch
Here is a reroll of just the parts of that patch that affects mimeMailRfcHeaders(). I made a number of additional changes, especially in variable naming and comments, in order to make the code clearer.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3145542-2-mime-mail-rfc-headers.patch | 4.3 KB | tr |
Comments
Comment #3
tr commentedComment #5
tr commentedCommitted.