mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
Sync. with php3. Only add Date: and From: if not supplied by user
This commit is contained in:
parent
f7072fbf87
commit
f6ad4b09c1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user