From 265f02e38151badf5d9f910799ff9df58f2f50d3 Mon Sep 17 00:00:00 2001 From: Guy Brand Date: Thu, 15 Feb 2007 19:46:09 +0100 Subject: RFC2047 fix for mail subjects (FS #1080) Patch by Per Foreby darcs-hash:20070215184609-19e2d-a5361f5009df14a3c21729758e758fe4ee2d1117.gz --- inc/mail.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/mail.php b/inc/mail.php index 02434cf3c..a31385914 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -39,8 +39,11 @@ function mail_send($to, $subject, $body, $from='', $cc='', $bcc='', $headers=nul $subject = utf8_strip($subject); } - if(!utf8_isASCII($subject)) + if(!utf8_isASCII($subject)) { $subject = '=?UTF-8?Q?'.mail_quotedprintable_encode($subject,0).'?='; + // Spaces must be encoded according to rfc2047. Use the "_" shorthand + $subject = preg_replace('/ /', '_', $subject); + } $header = ''; -- cgit v1.2.3