cvs: php4 /win32 sendmail.c

From: Date: Sun, 02 Jun 2002 23:40:00 +0000
Subject: cvs: php4 /win32 sendmail.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12205@lists.php.net to get a copy of this message
mfischer Sun Jun 2 19:40:00 2002 EDT Modified files: /php4/win32 sendmail.c Log: - 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. Index: php4/win32/sendmail.c diff -u php4/win32/sendmail.c:1.37 php4/win32/sendmail.c:1.38 --- php4/win32/sendmail.c:1.37 Sun Jun 2 18:54:48 2002 +++ php4/win32/sendmail.c Sun Jun 2 19:39:59 2002 @@ -17,7 +17,7 @@ * */ -/* $Id: sendmail.c,v 1.37 2002/06/02 22:54:48 mfischer Exp $ */ +/* $Id: sendmail.c,v 1.38 2002/06/02 23:39:59 mfischer Exp $ */ #include "php.h" /*php specific */ #include <stdio.h> @@ -545,9 +545,14 @@ 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;

« previous php.cvs (#12205) next »