Sync. with php3. Only add Date: and From: if not supplied by user

This commit is contained in:
Frank M. Kromann 1999-06-10 09:10:07 +00:00
parent f7072fbf87
commit f6ad4b09c1

View File

@ -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 || !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 && strnicmp("From:",xheaders,5)){
if(!xheaders || !strstr(xheaders, "From:")){
p += sprintf(p, "From: %s\r\n", RPath);
}
p += sprintf(p, "Subject: %s\r\n", Subject);