From ddcd5ab6a4c6b64d7948bd2d103c2ecd5a1ca618 Mon Sep 17 00:00:00 2001 From: Kazutaka Miyasaka Date: Mon, 6 Jun 2011 19:01:06 +0900 Subject: fixed email subject encoding bug ($enc_subj typo) --- inc/mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/mail.php') diff --git a/inc/mail.php b/inc/mail.php index bd6c0db6a..8742e17f6 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -114,7 +114,7 @@ function _mail_send_action($data) { if(!utf8_isASCII($subject)) { $enc_subj = '=?UTF-8?Q?'.mail_quotedprintable_encode($subject,0).'?='; // Spaces must be encoded according to rfc2047. Use the "_" shorthand - $enc_sub = preg_replace('/ /', '_', $enc_sub); + $enc_subj = preg_replace('/ /', '_', $enc_subj); // quoted printable has length restriction, use base64 if needed if(strlen($subject) > 74){ -- cgit v1.2.3 From 96569d486b765a54033635135007a20bc4368868 Mon Sep 17 00:00:00 2001 From: Matthias Schulte Date: Sun, 26 Jun 2011 16:54:34 +0200 Subject: The mail() function shouldn't be executed when no recipients are given. Empty to, cc or bcc fields could lead to an Internal Server Error: malformed header from script. Bad header=No recipient addresses found... --- inc/mail.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc/mail.php') diff --git a/inc/mail.php b/inc/mail.php index 8742e17f6..01b2895e1 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -104,6 +104,9 @@ function _mail_send_action($data) { $headers = isset($data['headers']) ? $data['headers'] : null; $params = isset($data['params']) ? $data['params'] : null; + // discard mail request if no recipients are available + if(trim($to) === '' && trim($cc) === '' && trim($bcc) === '') return false; + // end additional code to support event ... original mail_send() code from here if(defined('MAILHEADER_ASCIIONLY')){ -- cgit v1.2.3