Closed (won't fix)
Project:
Webform
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2007 at 22:17 UTC
Updated:
23 Feb 2011 at 22:05 UTC
When a user enters a date prior to January 1, 1970 (e.g. before the start of the Unix epoch), the e-mail which is sent when the form is submitted shows the date as "Jan 1, 1970". This is because the formatting code in date.inc uses strtotime(), which has undefined behaviour for dates earlier than the start of the Unix epoch.
This patch keeps the existing strtotime() formatting behaviour for dates on or after January 1, 1970. For dates earlier than this, the strtotime() formatting is skipped and the raw values (month number, day number, and year number) are included in the e-mail.
| Comment | File | Size | Author |
|---|---|---|---|
| date-pre1970.patch | 591 bytes | atipton |
Comments
Comment #1
quicksketchThis problem has been fixed in PHP 5.1 and higher. Since PHP4 is officially dead (as of 12-31-2007), this exception should no longer be an issue.
Comment #2
geerlingguy commentedI'm using PHP 5.2.14 on my server (4.x isn't even installed, nor is 5.1.x), and I'm still getting all pre-1970 dates converted to "January 1, 1970" in the notification emails. However, the date displays correctly (as the user has submitted it) on the website.
I haven't tested this on the 3.x branch.
I'm running CentOS 5.5, Apache 2.x, PHP 5.2.14.
(For my internal tracking: http://archstldev.com/node/735).
Comment #3
quicksketchI cannot confirm this problem on 3.x. 2.x is no longer supported.