#35218 [NEW]: strtotime no longer ignores timezone comments like (EST)
| From: | chagenbu@php.net | Date: | Mon, 14 Nov 2005 17:28:04 +0000 |
| Subject: | #35218 [NEW]: strtotime no longer ignores timezone comments like (EST) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-88156@lists.php.net to get a copy of this message | ||
From: chagenbu@php.net
Operating system: Debian 3.1/Kernel 2.6.7
PHP version: 5.1.0RC4
PHP Bug Type: Date/time related
Bug description: strtotime no longer ignores timezone comments like (EST)
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 bug report at http://bugs.php.net/?id=35218&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35218&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35218&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35218&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35218&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35218&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35218&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35218&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35218&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35218&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35218&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35218&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35218&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35218&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35218&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35218&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35218&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35218&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35218&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35218&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35218&r=mysqlcfg