In the function simplenews_mail_send the ' and " are escape with an addslashes. It obviously breaks the name where we have a ' and a ". I don't think that escaping is really needed here because mime_header_encode already encode all this. My suggestion is to simply remove the addslashes as follow. (Sorry I have no patch beacause I don't work on the CVS version). If need I can provide a patch against 1.0 (glups)
function simplenews_mail_send($mail) {
$from_email = isset($mail->from_address) ? $mail->from_address : variable_get('site_mail', ini_get('sendmail_from'));
$from = isset($mail->from_name) ? '"'. mime_header_encode($mail->from_name).'" <'. $from_email .'>' : $from_email;
Comments
Comment #1
cirotix commentedI meant a patch against 1.3
Comment #2
sutharsan commentedPlease describe what problems you have encountered.
See the original issue that made me add this piece of code to the module: http://drupal.org/node/238735 Please comment on this.
Comment #3
cirotix commentedmime_header_encode is prefectly fine.
The problem is with addslash. It will escape site name such as "L'avion" into "L\'avion". So the one who is receiving the message will get L\'avion as sender. Because your string is passed thru mime_header_encode, you don't need addslash any more.
Comment #4
sutharsan commentedThanks for the explanation. Patch committed.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.