Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > media > main-updates-src > by-pkgid > 5f84d7198ad7e76815a0aab8da1d5b40 > files > 3

php-5.2.1-4.4mdv2007.1.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);
 		}