Derick Rethans
d54bcbb43b
Add DatePeriod's __serialize and __unserialize methods ( #8464 )
2022-05-03 22:06:17 +01:00
Derick Rethans
c1ad706b82
Fixed reference count issue with zend_string
2022-04-29 14:33:16 +01:00
Derick Rethans
5fb36414a3
Fixed cloning DateInterval
2022-04-29 10:27:40 +01:00
Derick Rethans
cae1d4adde
Add support for serialising all DateInterval objects
2022-04-29 10:27:40 +01:00
Derick Rethans
83a6bcc157
Fixed cloning DateInterval
2022-04-29 10:27:40 +01:00
Derick Rethans
c8a6a8abc0
Rename have_special_relative to from_string, fix serialisation constraint, and reorder fields
2022-04-29 10:27:40 +01:00
Derick Rethans
f4e5010aa9
Show the 'have_special_relative' property in var_dumps, and disallow serialization if set
2022-04-29 10:27:40 +01:00
Derick Rethans
76e852e7e8
Fixed memory leak with manual calls to DateInterval::__unserialize
2022-04-29 10:27:40 +01:00
Derick Rethans
f869a546e7
Add DateInterval's __serialize and __unserialize methods
2022-04-29 10:27:38 +01:00
Derick Rethans
3be8b5f5cb
Remove fake properties from DateInterval
2022-04-29 10:26:50 +01:00
Derick Rethans
6f2c5017f9
Fixed memory leak with unserialize was called multiple times and an abbreviation was stored
2022-04-29 09:44:27 +01:00
Derick Rethans
181623f9c0
Add DateTimeZone's __serialize and __unserialize methods
2022-04-29 09:44:27 +01:00
Derick Rethans
8b2ee5388c
Add DateTime/DateTimeImmutable's __serialize and __unserialize methods
2022-04-29 09:44:27 +01:00
Derick Rethans
36486106d9
Merge branch 'PHP-8.1'
2022-04-26 17:58:01 +01:00
Derick Rethans
97ffd75b13
Merge branch 'PHP-8.0' into PHP-8.1
2022-04-26 17:57:55 +01:00
Derick Rethans
b461c4673b
Use the new RETURN_THROWS() instead of just returning NULL
2022-04-26 17:57:47 +01:00
Derick Rethans
a7eda3d548
Merge branch 'PHP-8.1'
2022-04-26 16:45:07 +01:00
Derick Rethans
bc43e69822
Merge branch 'PHP-8.0' into PHP-8.1
2022-04-26 16:45:01 +01:00
Derick Rethans
87f341b1c2
Return early when the timezone info is NULL.
...
The guess_timezone function does throw an error, but throwing an error doesn't
immediate make the PHP_FUNCTION return.
This check is really only necessary for distributions that patch PHP's timelib
to use system tzdata, but not correct enough to account for their
implementation to guarantee to return a timezone.
2022-04-26 16:43:30 +01:00
Derick Rethans
731e3f6c96
Merge branch 'PHP-8.1'
2022-04-14 10:32:25 +01:00
Derick Rethans
ec0771c03f
Merge branch 'PHP-8.0' into PHP-8.1
2022-04-14 10:32:21 +01:00
Derick Rethans
e38d300a70
Refactor code to avoid duplication
2022-04-14 10:32:10 +01:00
Cody Mann
24085d0192
style/readability updates
2022-04-14 10:22:00 +01:00
Cody Mann
287c8a86b4
GH-7979: iterator advances when checking if valid
2022-04-14 10:22:00 +01:00
Derick Rethans
cd6c338c89
Merge branch 'PHP-8.1'
2022-04-01 13:28:13 +01:00
Derick Rethans
e6c4988187
Fixed #7752 , #8101 , #81660 : DateTimeZone::getTransitions() returns insufficient data
2022-04-01 13:28:05 +01:00
Christoph M. Becker
b7d90f09d4
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Fix #81500 : Interval serialization regression since 7.3.14 / 7.4.2
2021-10-15 19:14:00 +02:00
Christoph M. Becker
2e65c8e581
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Fix #81500 : Interval serialization regression since 7.3.14 / 7.4.2
2021-10-15 19:13:38 +02:00
Christoph M. Becker
fc886694d3
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #81500 : Interval serialization regression since 7.3.14 / 7.4.2
2021-10-15 19:11:26 +02:00
Christoph M. Becker
866adb122a
Fix #81500 : Interval serialization regression since 7.3.14 / 7.4.2
...
While it may not be desired, `DateInterval::$f` supports negative
values, at least with regard to calculations. We still need to guard
from assigning double values which are out of range for signed 64bit
integers (which would be undefined behavior). zend_dval_to_lval() does
this by returning `0` instead of triggering UB. This way we can avoid
setting the invalid marker, which doesn't work as expected anyway.
We must not do that only for unserialization, but also when the property
is set in the first place.
We need to adapt some of the existing tests wrt. this behavior. In
particular, we check for an arbitrary value in bug79015.phpt, to cater
to differences between 32bit and 64bit architectures.
Closes GH-7575.
2021-10-15 19:08:07 +02:00
Derick Rethans
0d6b8bbfcd
Merge branch 'PHP-8.1'
2021-10-05 15:23:05 +01:00
Derick Rethans
68b874d10d
Fixed bug #81504 : Incorrect timezone transition details for POSIX data
2021-10-05 15:22:55 +01:00
George Peter Banyard
0663c64f41
Voidify php_date_interval_initialize_from_hash()
2021-09-29 17:15:50 +01:00
George Peter Banyard
492980c540
Use bool/zend_result instead of int in Date extension
2021-09-29 17:15:50 +01:00
Nikita Popov
9d8f97d58d
Revert "Fix DATE_FORMAT_COOKIE definition"
...
This reverts commit ac34648cf6
.
As pointed out on GH-6783, the new format doesn't match any of
the specified formats. Previously the constant generated
Thursday, 14-Jul-2005 22:30:41 BST
which is obsolete. Now it generates
Thu, 14-Jul-2005 22:30:41 BST
which is not specified at all. The correct version would be:
Thu, 14 Jul 2005 22:30:41 BST
Reverting the change for now.
2021-09-29 09:26:40 +02:00
Mahmood Dhia
ac34648cf6
Fix DATE_FORMAT_COOKIE definition
...
In all of http://curl.haxx.se/rfc/cookie_spec.html ,
https://docs.microsoft.com/de-de/windows/win32/wininet/http-cookies
and https://tools.ietf.org/html/rfc7234#section-5.3 the cookie
datetime is specified as Mon, DD-Mon-YYYY HH:MM:SS GMT. However,
the current definition returns Monday, DD-Mon-YYY HH:MM:SS GMT.
Therefore, the "l" in "l, d-M-Y H:i:s T" must be changed to "D".
Closes GH-6783.
2021-09-23 16:01:04 +02:00
Derick Rethans
d9c8e5a42e
Fixed bug #80963 : DateTimeZone::getTransitions() truncated
2021-08-08 17:27:21 +01:00
Derick Rethans
84008782d3
Merge branch 'PHP-8.0'
2021-07-19 15:08:21 +01:00
Derick Rethans
9d0fb10823
Merge branch 'PHP-7.4' into PHP-8.0
2021-07-19 15:08:09 +01:00
Derick Rethans
26b1572d37
Move date timezone cache destruction to post deactivate
...
Some extensions try to use the date features in their own shutdown,
most notably some logging functions. Because of that, move the
cache tear down until after these resources have been cleaned up.
2021-07-19 15:07:01 +01:00
Patrick Allaert
aff365871a
Fixed some spaces used instead of tabs
2021-06-29 11:30:26 +02:00
George Peter Banyard
2f1d0f2bc3
Throw directly instead of replacing error handler in ext/date ( #6954 )
2021-05-07 11:10:39 +01:00
Nikita Popov
3b3f6de782
Use zend_string_concat3 in one place
...
A bit nicer than snprintf + passing the same length around three
times.
2021-05-07 10:43:40 +02:00
George Peter Banyard
2cd5a200f5
Refactor php_date_initialize_from_hash()
...
Use early returns
Formalize return type to bool
2021-05-06 21:48:52 +01:00
KsaR
01b3fc03c3
Update http->https in license ( #6945 )
...
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
...
And use it instead of comments
2021-04-07 00:46:29 +01:00
Derick Rethans
091c0920b9
Upgrade timelib to 2021.03 and fix many date/time issues
2021-04-06 20:50:32 +01:00
George Peter Banyard
6acb079906
Use zend_string_equals() API instead of strcmp() in Date extension
2021-03-17 16:36:16 +00:00
Dmitry Stogov
b4e9b18463
Avoid useless date conversion
2021-03-04 12:27:31 +03:00
Máté Kocsis
5f21062054
Generate class entries for a few extensions
...
Relates to GH-6644
2021-02-03 09:24:09 +01:00