Hi guys,
I've been wondering for a long time... why is it that my subject line includes ^J characters (i.e. "\n")?!
So today I decided to look into it. The fact is that you want to make sure that the subject line is "clean" (i.e. does not include HTML tags.) For that reason, you call drupal_html_to_text(). This is a somewhat good idea, except that the function also wrap words on a given boundary (about 70 characters.) That means any subject that is "too long" gets wrapped and not it includes a new-line character.
I'm attaching a fix if you really want to continue to support the drupal_html_to_text() call. Although I'd suggest a strip_tags() and check_plain() calls instead.
$subject = mime_header_encode(trim(check_plain(strip_tags($subject))));
Thank you.
Alexis Wilke
| Comment | File | Size | Author |
|---|---|---|---|
| mimemail-6.x-subject_newline.patch | 577 bytes | AlexisWilke |
Comments
Comment #1
sgabe commentedI am marking this as duplicate of #438058: Remove line feeds in subject. Please post your idea and followup that issue there.