1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Commit Graph

865 Commits

Author SHA1 Message Date
Derick Rethans 25744dd73c Merge branch 'PHP-8.0' into PHP-8.1 2022-10-17 18:22:36 +01:00
Derick Rethans 7b48053293 Fixed GH-9763: DateTimeZone ctr mishandles input and adds null byte if the argument is an offset larger than 100*60 minutes 2022-10-17 17:08:44 +01:00
Derick Rethans dd365b044a Add 'const' to match actual API 2022-09-14 11:02:26 +01:00
Derick Rethans b0d67aa605 Merge remote-tracking branch 'derickr/bug80047-take2' into PHP-8.1 2022-07-28 11:48:30 +01:00
Derick Rethans 001e7dbb04 Fixed bug #80047 (DatePeriod doesn't warn with custom DateTimeImmutable) 2022-07-28 10:28:10 +01:00
Derick Rethans 85f3a969dc Revert "Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable"
This reverts commit 973c3f6e24.
2022-07-28 10:13:54 +01:00
Derick Rethans 49a3cc63dd Merge branch 'PHP-8.0' into PHP-8.1 2022-06-25 17:53:26 +01:00
Derick Rethans 973c3f6e24 Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable 2022-06-25 17:52:14 +01:00
Derick Rethans f3d23d45c0 Merge branch 'PHP-8.0' into PHP-8.1 2022-05-27 14:44:06 +01:00
Derick Rethans d5e57268a9 Fixed bug #78139 (timezone_open accepts invalid timezone string argument). 2022-05-27 14:43:04 +01:00
Derick Rethans 4f32983fbe Merge branch 'PHP-8.0' into PHP-8.1 2022-05-27 14:27:29 +01:00
Derick Rethans 6418eba1cd Fixed bug #74671 (DST timezone abbreviation has incorrect offset) 2022-05-27 09:33:20 +01:00
Derick Rethans a04eccb294 Merge branch 'PHP-8.0' into PHP-8.1 2022-05-26 15:19:27 +01:00
Derick Rethans dfd1d7a531 Fixed bug #76963 (Null-byte injection in createFromFormat) 2022-05-26 13:49:51 +01:00
Derick Rethans 7670ee4342 Merge branch 'PHP-8.0' into PHP-8.1 2022-05-05 15:24:10 +01:00
Derick Rethans 92f8f19d50 Fixed GH-8471: Segmentation fault when converting immutable and mutable DateTime instances created using reflection 2022-05-05 12:10:50 +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 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 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 e6c4988187 Fixed #7752, #8101, #81660: DateTimeZone::getTransitions() returns insufficient data 2022-04-01 13:28:05 +01: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 68b874d10d Fixed bug #81504: Incorrect timezone transition details for POSIX data 2021-10-05 15:22:55 +01: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
Nikita Popov 3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Máté Kocsis 41b096b392 Promote a few forgotten warnings to exceptions
Closes GH-6211
2020-09-25 12:08:15 +02:00
George Peter Banyard 95f4ee38bb Add some ValueErrors to ext/date
Closes GH-5613
2020-09-16 01:29:28 +02:00
Máté Kocsis 8e8a277b2f Slightly improve error handling in DatePeriod::__construct() 2020-09-14 11:59:51 +02:00
Derick Rethans 2ee2335249 Fixed bug #80057 (DateTimeImmutable::createFromFormat() does not populate time) 2020-09-04 15:55:08 +01:00
Nikita Popov ecd986c879 Fix build warnings after timelib update 2020-08-31 14:28:39 +02:00
Nikita Popov ac98ac7225 Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't assert when comparing uninit DateTimeZone objects
2020-08-27 16:20:24 +02:00