Sophie

Sophie

distrib > Mandriva > cs4.0 > i586 > by-pkgid > 665b53d51b37ef4d3a9c620ff5a368c6 > files > 9

php4-4.4.4-1mlcs4.src.rpm

--- php-4.3.0/ext/standard/mail.c.orig	2003-01-04 04:53:16.000000000 -0400
+++ php-4.3.0/ext/standard/mail.c	2003-01-04 04:57:38.000000000 -0400
@@ -21,6 +21,8 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <stdio.h>
+#include <syslog.h>
+#include <string.h>
 #include "php.h"
 #include "ext/standard/info.h"
 
@@ -196,8 +198,12 @@
 			return 0;
 		}
 #endif
-		fprintf(sendmail, "To: %s\n", to);
-		fprintf(sendmail, "Subject: %s\n", subject);
+		if ((to != NULL) && (strlen(to)!=0)) {
+			fprintf(sendmail, "To: %s\n", to);
+		}
+		if ((subject != NULL) && (strlen(subject)!=0)) {
+			fprintf(sendmail, "Subject: %s\n", subject);
+		}
 		if (headers != NULL) {
 			fprintf(sendmail, "%s\n", headers);
 		}