summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>1999-06-10 09:10:07 +0000
committerFrank M. Kromann <fmk@php.net>1999-06-10 09:10:07 +0000
commitf6ad4b09c1d456c7b91bf88ca8dbb3550c31e5d9 (patch)
treec6ba095c0afab5cfe8911ca136e95a1b3016b1f9 /win32
parentf7072fbf879278b69ea7966bcc3e05cf9c681284 (diff)
downloadphp-git-f6ad4b09c1d456c7b91bf88ca8dbb3550c31e5d9.tar.gz
Sync. with php3. Only add Date: and From: if not supplied by user
Diffstat (limited to 'win32')
-rw-r--r--win32/sendmail.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c
index fbc76752ba..2a32cff950 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -316,19 +316,21 @@ int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders)
zoneh /= (60 * 60);
zonem = (abs(_timezone) / 60) - (zoneh * 60);
- p += sprintf(p, "Date: %s, %02d %s %04d %02d:%02d:%02d %s%02d%02d\r\n",
- days[tm->tm_wday],
- tm->tm_mday,
- months[tm->tm_mon],
- tm->tm_year + 1900,
- tm->tm_hour,
- tm->tm_min,
- tm->tm_sec,
- (_timezone > 0) ? "+" : (_timezone < 0) ? "-" : "",
- zoneh,
- zonem);
-
- if(xheaders && strnicmp("From:",xheaders,5)){
+ if(!xheaders || !strstr(xheaders, "Date:")){
+ p += sprintf(p, "Date: %s, %02d %s %04d %02d:%02d:%02d %s%02d%02d\r\n",
+ days[tm->tm_wday],
+ tm->tm_mday,
+ months[tm->tm_mon],
+ tm->tm_year + 1900,
+ tm->tm_hour,
+ tm->tm_min,
+ tm->tm_sec,
+ (_timezone > 0) ? "+" : (_timezone < 0) ? "-" : "",
+ zoneh,
+ zonem);
+ }
+
+ if(!xheaders || !strstr(xheaders, "From:")){
p += sprintf(p, "From: %s\r\n", RPath);
}
p += sprintf(p, "Subject: %s\r\n", Subject);