mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
- 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.
This commit is contained in:
parent
d497ca147e
commit
9a97d55647
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user