Wondering if someone could help. I create a newsletter using FCKeditor as the wysiwig editor. If the title contains & and I use the node title as an email subject the & appears as a "_amp;" quotes appear in the subject as "_quot;". I am using Mimemail plaintext. This doesnt occur with all characters in the body. For example in the body & character appears as & quotes appear as "" however a bullet character appears as "_bull;" I had substitute the & and underscore to demonstrate the problem.

Comments

jerdavis’s picture

Can you paste the raw message source here?

Jer Davis
Advantage Labs, Inc.

smalld’s picture

node title = Test _amp; Test

should appear as Test & Test
but appears as Test _amp; Test

Body = Test _amp; Test _quot; Test _quote; _bull;

should appear as Test & Test "Test" •
but appears as Test & Test "Test" _bull; only the bullet entity in the body is not displayed correctly.

the & is substituted with an underscore so I can display this message.

smalld’s picture

I solved the two problems with following. To solve the body not converting a broader range of entities I applied the following patch.
http://drupal.org/node/212130 212130-D6-decode-entities-support-all-entities.patch

To solve entities not converted in the email subject. I added the following line of code to Mimemail.module.

$subject = mime_header_encode($subject);

//Added the following line to convert HTML entities appearing in the subject line
$subject = drupal_html_to_text($subject);

$plaintext = $plaintext || variable_get('mimemail_textonly', 0);

Im not sure if this is the right way to go about this but it appears to work. Im doing some further testing.

Sutharsan’s picture

A similar issue was solved in Simplenews some time ago (#348392: Raw HTML characters in newsletter title and from address). It was caused by the use of check_plain(). Escaping the newsletter title and email address name is not needed. Perhaps this helps solving this issue.

@smalld: you can use <code> to display &amp; in the text. See the formatting instruction below the comment field.

jerdavis’s picture

Status: Active » Fixed

Added drupal_html_to_text() call on $subject

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.