1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Commit Graph

1307 Commits

Author SHA1 Message Date
Ilija Tovilo
73fc2db234 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix date_sunrise() and date_sunset() with partial-hour UTC offset
2025-09-03 13:35:04 +02:00
Ilija Tovilo
0ae9a58ade Fix date_sunrise() and date_sunset() with partial-hour UTC offset
See GH-19633
Closes GH-19672
2025-09-03 13:34:03 +02:00
Niels Dossche
06f592820d Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak in tidy output handler on error
  Fix leaks with multiple calls to DatePeriod iterator current()
2025-05-26 19:42:20 +02:00
Niels Dossche
ff2c7dc0f8 Fix leaks with multiple calls to DatePeriod iterator current()
Destroy the old value first. We can't skip recreating the value because
the object may have been changed in between calls.

Closes GH-18624.
2025-05-26 19:40:41 +02:00
David Carlier
a7b78a5091 Fix ext/date: date_sunrise() new tests.
close GH-18489
2025-05-03 19:40:16 +01:00
David Carlier
004d7cd290 Merge branch 'PHP-8.3' into PHP-8.4 2025-05-03 16:56:32 +01:00
David Carlier
0227d96f48 Fix GH-18481: date_sunrise check sun rise with offset if is finite/is nan
close GH-18484
2025-05-03 16:56:09 +01:00
Derick Rethans
d54aee5b0c Merge branch 'PHP-8.3' into PHP-8.4 2025-04-22 17:11:15 +01:00
Carlos Buenosvinos
c9f3127ca8 Fix GH-18076: date_sun_info() function returns inaccurate sunrise and sunset times
Closes GH-18317: Avoid double counting the 15 minutes radial correction of the sun
2025-04-22 16:45:57 +01:00
Niels Dossche
a019fbd970 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18309: ipv6 filter integer overflow
  Fix GH-18304: Changing the properties of a DateInterval through dynamic properties triggers a SegFault
2025-04-11 23:36:12 +02:00
Niels Dossche
ba0853888d Fix GH-18304: Changing the properties of a DateInterval through dynamic properties triggers a SegFault
For dynamic fetches the cache_slot will be NULL, so we have to check for
that when resetting the cache. For zip and xmlreader this couldn't
easily be tested because of a lack of writable properties.

Closes GH-18307.
2025-04-11 23:33:58 +02:00
Ilija Tovilo
253c579c25 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix flaky DatePeriod test
2025-03-06 15:04:29 +01:00
Ilija Tovilo
a840a54fbc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix flaky DatePeriod test
2025-03-06 15:04:18 +01:00
Ilija Tovilo
9256ee7b1b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix flaky DatePeriod test
2025-03-06 15:04:08 +01:00
Ilija Tovilo
8a699372f2 Fix flaky DatePeriod test
$start and $end use the H:i:s from the current time. If $end happens on
a second boundary, $start + 4 days will include $end, thus performing an
extra iteration. Fix this by setting H:i:s to 00:00:00.
2025-03-06 15:01:30 +01:00
David Carlier
aa815f32ae Merge branch 'PHP-8.3' into PHP-8.4 2024-12-20 15:09:49 +00:00
David Carlier
16c0e57530 Fix GH-14709 overflow on recurrences for DatePeriod::__construct
close GH-14710
2024-12-20 15:03:47 +00:00
Christoph M. Becker
68d3000902 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-14732: date_sun_info() fails for non-finite values
2024-11-01 23:50:40 +01:00
Christoph M. Becker
8df513336a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14732: date_sun_info() fails for non-finite values
2024-11-01 23:47:21 +01:00
Christoph M. Becker
f9453a889d Fix GH-14732: date_sun_info() fails for non-finite values
`timelib_astro_rise_set_altitude()` is not prepared to deal with non-
finite values (`nan`, `inf` and `-inf`) for `lon` and `lat`; instead
these trigger undefined behavior.  Thus we catch non-finite values
before even calling that timelib function; for `date_sun_info()` we
trigger `ValueError`s; for `date_sunrise()` and `date_sunset()` we
silently return `false`, since these functions will be sunsetted
anyway.

Closes GH-16497.
2024-11-01 23:46:19 +01:00
Derick Rethans
9923e14d97 Merge branch 'PHP-8.3' into PHP-8.4 2024-10-18 12:38:21 +01:00
Derick Rethans
8acdde5b10 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-18 12:38:06 +01:00
Derick Rethans
b2b294a2b2 Fixed bug GH-16037 (Assertion failure in ext/date/php_date.c) 2024-10-18 12:37:03 +01:00
Christoph M. Becker
66fe549daf Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16454: Unhandled INF in date_sunset() with tiny $utcOffset
2024-10-18 13:25:05 +02:00
Christoph M. Becker
64f312f123 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16454: Unhandled INF in date_sunset() with tiny $utcOffset
2024-10-18 13:22:55 +02:00
Christoph M. Becker
9bc34182b6 Fix GH-16454: Unhandled INF in date_sunset() with tiny $utcOffset
After normalization, `N` is supposed to be in range [0, 24], but for
very large and very small `$utcOffset` this is not necessarily the
case, since the normalization might yied `-inf` or `inf`.  If that
happens, we let the function fail silently, since it is highly unlikely
that such `$utcOffset`s are passed in practice.

Closes GH-16483.
2024-10-18 13:21:57 +02:00
Máté Kocsis
274ae05c4e Merge branch 'PHP-8.3'
* PHP-8.3:
  Add missing returns in ext/date for PHP 8.3+ (#15735)
2024-09-14 22:15:49 +02:00
Máté Kocsis
cb69900407 Add missing returns in ext/date for PHP 8.3+ (#15735)
Issues originally found in #15598
2024-09-14 22:15:22 +02:00
Derick Rethans
9698ad2fc0 Merge branch 'PHP-8.3' 2024-09-11 17:44:18 +01:00
Derick Rethans
b0bead499c Merge branch 'PHP-8.2' into PHP-8.3 2024-09-11 17:44:11 +01:00
Derick Rethans
8a8859bce7 Fixed regression: Using more than one sign is now OK again when using modify() 2024-09-11 17:43:23 +01:00
Derick Rethans
e255889fea Merge branch 'PHP-8.3' 2024-09-11 16:41:35 +01:00
Derick Rethans
9ebdbe2f41 Merge branch 'PHP-8.2' into PHP-8.3 2024-09-11 16:41:30 +01:00
Derick Rethans
f752e23cff Fix GH-15582: Crash when not calling parent constructor of DateTimeZone 2024-09-11 16:37:40 +01:00
Marc Bennewitz
d6113ba8fe fixes #13773: DatePeriod does not take microseconds into account 2024-08-21 10:57:46 +01:00
Jorg Adam Sowa
b9fef523c1 Deprecate date_sunrise and date_sunset constants (#12978)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
2024-08-04 20:07:52 +02:00
Tim Düsterhus
29f98e7485 Replace @deprecated by #[\Deprecated] for internal functions / class constants (#14750)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-07-10 16:47:31 +02:00
Saki Takamachi
bfc988552f Fixed GH-14383: Fixed usec was carry up (#14463)
If round to the fractional part of a timestamp, a carry will occur in cases
such as 999 999 9. In that case, set usec to 0 and add/sub 1 to sec.
2024-06-11 19:02:43 +09:00
Derick Rethans
92d18b2bec Fixed rounding error with new DateTime[Immutable]::createFromTimestamp method 2024-05-30 14:08:39 +01:00
Máté Kocsis
330cc5cdb2 Deprecate implicit nullable parameter types (#12959)
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-03-13 21:40:26 +01:00
Marc Bennewitz
dbd976a67f Singular DateTime::[get|set]Microsecond & no tentative return type (#13486)
* Singular DateTime::[get|set]Microsecond & no tentative return type

* Added missing getMicrosecond to DateTimeInterface
2024-03-06 09:18:22 +00:00
Marc Bennewitz
9f586f6c69 Fixed int32 underflow on DateTime::createFromTimestamp (#12775)
* Fixed int32 underflow on DateTime::createFromTimestamp
2024-02-27 14:01:49 +00:00
Matteo Beccati
5373f5dd9d Fix test on non-UTC environments 2024-02-19 15:18:48 +01:00
Marc Bennewitz
0016b3085c Added DateTime[Immutable]::[get|set]Microseconds (#12557)
* Added DateTime[Immutable]::[get|set]Microseconds
2024-02-05 12:14:18 +00:00
Derick Rethans
cba4c409b1 Merge branch 'PHP-8.3' 2024-01-02 11:07:36 +00:00
Derick Rethans
9111a39ffa Merge branch 'PHP-8.2' into PHP-8.3 2024-01-02 11:07:24 +00:00
Derick Rethans
c7816bf730 tzdata 2023d adds an extra transition for Europe/London 2024-01-02 11:07:12 +00:00
Máté Kocsis
adc26424aa Deprecate calling DatePeriod::__construct() with less than 3 arguments 2023-12-04 22:27:59 +01:00
Ilija Tovilo
1ade8ef7d3 [skip ci] Skip failing date test on 32-bit 2023-11-28 00:26:30 +01:00
Ilija Tovilo
f6efd126a5 Fix date createFromTimestamp test (#12766)
Unfortuantely, PHP_INT_MIN cannot be expressed as a literal in PHP, because -NUM
is parsed as (-)(NUM). NUM is restricted to PHP_INT_MAX.
2023-11-24 14:24:32 +01:00