#35218 [Opn->Asn]: strtotime no longer ignores timezone comments like (EST)
| From: | tony2001@php.net | Date: | Mon, 14 Nov 2005 18:57:36 +0000 |
| Subject: | #35218 [Opn->Asn]: strtotime no longer ignores timezone comments like (EST) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-88164@lists.php.net to get a copy of this message | ||
ID: 35218
Updated by: tony2001@php.net
Reported By: chagenbu@php.net
-Status: Open
+Status: Assigned
Bug Type: Date/time related
Operating System: Debian 3.1/Kernel 2.6.7
PHP Version: 5.1.0RC4
-Assigned To:
+Assigned To: derick
New Comment:
Assigned to the author of this part.
Previous Comments:
------------------------------------------------------------------------
[2005-11-14 18:28:03] chagenbu@php.net
Description:
------------
A number of mail clients or mail generating scripts generate Date:
headers that use the following format:
Sun, 13 Nov 2005 22:56:10 -0800 (PST)
The final part - " (PST)" is not required (and probably technically
invalid) by the date format described in RFC 2822, however, it's also
probably valid as a header comment. Prior to the 5.1 branch, PHP's
strtotime simply ignored comments in this style; however, with 5.1, it
causes strtotime to fail and return false. Valid or invalid I think
it'd be good for PHP to ignore these and just parse the rest of the
date.
Reproduce code:
---------------
<?php
$date = 'Sun, 13 Nov 2005 22:56:10 -0800 (PST)';
$date_fixed = 'Sun, 13 Nov 2005 22:56:10 -0800';
var_dump(strtotime($date));
var_dump(strtotime($date_fixed));
Expected result:
----------------
int(1131951370)
int(1131951370)
Actual result:
--------------
bool(false)
int(1131951370)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35218&edit=1