|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8909 PHP generates the Date: header line with a bad timezone
Submitted: 2001-01-25 11:54 UTC Modified: 2001-11-30 04:28 UTC
From: rthornto at pictel dot com Assigned:
Status: Closed Package: Mail related
PHP Version: 4.0.4pl1 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rthornto at pictel dot com
New email:
PHP Version: OS:


 [2001-01-25 11:54 UTC] rthornto at pictel dot com
If the PHP mail() function is allowed to generate the "Date:" header field, the sign of the timezone is inverted.

The system "timezone" is the number of minutes difference between UTC and local time (EST= +300).  In the Date: header, the timezone is formatted as "HHMM" and is the difference between local time and UTC (reversed difference, EST= -0500).

In win32/sendmail.c, the sign of the system "timezone" variable is copied to the Date: header without being inverted.

Also, there should be a sign even if the timezone offset is 0.  Therefore in sprintf() that generates the "Date:" header in the PostHeader() function, the timezone test should read:
      (_timezone > 0) ? "-" : "+",

This problem was also in the PHP3 source.

Regard, -Ron-


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-22 18:28 UTC]
windows mailcode needs a rewrite
 [2001-11-30 04:28 UTC]
This is now fixed in CVS (I hope).

 [2002-01-23 12:41 UTC] tob at golflink dot net
This is marked as closed but I'm still seeing this same problem on the latest windows release. 4.1
 [2002-01-23 16:09 UTC] walter dot pollard at unisys dot com

      Derick, which release is this problem fixed in? We are running PHP Version 4.0.6 and are experiencing the same problem.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Sep 26 13:05:56 2022 UTC