Bug #75035 [Opn->Csd]: Datetime fails to unserialize "extreme" dates
| From: | derick@php.net | Date: | Fri, 22 Jul 2022 14:38:42 +0000 |
| Subject: | Bug #75035 [Opn->Csd]: Datetime fails to unserialize "extreme" dates | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-241982@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75035&edit=1
ID: 75035
Updated by: derick@php.net
Reported by: weirdan at gmail dot com
Summary: Datetime fails to unserialize "extreme" dates
-Status: Open
+Status: Closed
Type: Bug
Package: Date/time related
Operating System: Debian Linux / sid
PHP Version: 7.1.8
-Assigned To:
+Assigned To: derick
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test.
Thank you for the report, and for helping us make PHP better.
https://github.com/php/php-src/commit/9dcb0bd1dc966a70cf6386ca9d49979dd417e0c5
Previous Comments:
------------------------------------------------------------------------
[2021-06-29 16:09:30] ganbayar dot gansukh at kellpro dot com
Experiencing same bug on 7.4.19
------------------------------------------------------------------------
[2020-12-04 12:51:35] cmb@php.net
Related To: Bug #80483
------------------------------------------------------------------------
[2017-08-05 19:15:38] as@php.net
https://github.com/php/php-src/pull/2672
------------------------------------------------------------------------
[2017-08-05 17:20:35] weirdan at gmail dot com
> However it is also at odds with the fix for bug #62852, which asserts that a 5-digit year
> should fail to unserialize
It doesn't fail *all* 5-digits years though (just mangles the data), see this output line (the
number in square brackets is the timestamp, to aid with reproduction):
string(59) "[1099511627775] 36812-02-20 00:36:15 => 2002-02-20 00:36:15"
------------------------------------------------------------------------
[2017-08-05 17:04:53] weirdan at gmail dot com
Also, documentation[1] says:
> The date and time information is internally stored as a 64-bit number so all conceivably useful
> dates (including negative years) are supported. The range is from about 292 billion years in the
> past to the same in the future.
[1] http://php.net/manual/en/intro.datetime.php
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=75035
--
Edit this bug report at https://bugs.php.net/bug.php?id=75035&edit=1