diff options
author | Markus Fischer <mfischer@php.net> | 2002-06-02 23:39:59 +0000 |
---|---|---|
committer | Markus Fischer <mfischer@php.net> | 2002-06-02 23:39:59 +0000 |
commit | 9a97d55647dfcde9d814ac056945182d18965a79 (patch) | |
tree | d99c51a5894e025fd9e54007cfb7b70cc5563d0a /win32/sendmail.c | |
parent | d497ca147e895dffba1bbd07a981f0d71914cd3c (diff) | |
download | php-git-9a97d55647dfcde9d814ac056945182d18965a79.tar.gz |
- Only add the To: field with the $to parameter if we don't have it in the
custom header. This was the behaviour < 4.2.x (but it was broken, this one
isn't).
# last commit for today, promised.
Diffstat (limited to 'win32/sendmail.c')
-rw-r--r-- | win32/sendmail.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c index 28d26d23d0..4266aa7509 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -545,9 +545,14 @@ int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders, char *m if (!addToHeader(&header_buffer, "Subject: %s\r\n", Subject)) { goto PostHeader_outofmem; } - if (!addToHeader(&header_buffer, "To: %s\r\n", mailTo)) { - goto PostHeader_outofmem; + + /* Only add the To: field from the $to parameter if isn't in the custom headers */ + if ((headers_lc && (!strstr(headers_lc, "\r\nto:") && (strncmp(headers_lc, "to:", 3) != 0))) || !headers_lc) { + if (!addToHeader(&header_buffer, "To: %s\r\n", mailTo)) { + goto PostHeader_outofmem; + } } + if (mailCc && *mailCc) { if (!addToHeader(&header_buffer, "Cc: %s\r\n", mailCc)) { goto PostHeader_outofmem; |