From b14204f3320cae9a2ac1638e859b16742ad94dbb Mon Sep 17 00:00:00 2001 From: Bob Vincent Date: Sat, 12 Mar 2011 02:24:05 -0500 Subject: [PATCH] Strip newline characters from mail subject. --- includes/mail.inc | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/includes/mail.inc b/includes/mail.inc index a778ac5..763223b 100644 --- a/includes/mail.inc +++ b/includes/mail.inc @@ -182,7 +182,9 @@ function drupal_mail_send($message) { } return mail( $message['to'], - mime_header_encode($message['subject']), + // The email might not be sent properly if the subject line contains + // newline characters. + str_replace("\n", ' ', mime_header_encode($message['subject'])), // Note: e-mail uses CRLF for line-endings, but PHP's API requires LF. // They will appear correctly in the actual e-mail that is sent. str_replace("\r", '', $message['body']), -- 1.7.1