ID:               35218
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-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] [EMAIL PROTECTED]

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

Reply via email to