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

2704 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
Derick Rethans
22b2a579ba Updated to version 2025.2 (2025b) 2025-03-24 10:06:34 +00:00
Derick Rethans
0c8a7a77a8 Updated to version 2025.2 (2025b) 2025-03-24 10:06:32 +00: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
Niels Dossche
ee4a9a4a7c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17736: Assertion failure zend_reference_destroy()
2025-03-02 22:37:07 +01:00
Niels Dossche
ce8ab5f16a Fix GH-17736: Assertion failure zend_reference_destroy()
The cache slot for FETCH_OBJ_W in function `test` is primed with the
class for C. The next call uses a simplexml instance and reuses the same
cache slot. simplexml's get_property_ptr handler does not use the cache
slot, so the old values remain in the cache slot. When
`zend_handle_fetch_obj_flags` is called this is not guarded by a check
for the class entry. So we end up using the prop_info from the property
C::$a instead of the simplexml property.

This patch adds a reset to the cache slots in the property address fetch
code and also in the extensions with a non-standard reference handler.
This keeps the run time cache consistent and avoids the issue without
complicating the fast paths.

Closes GH-17739.
2025-03-02 22:33:32 +01:00
Derick Rethans
4333009190 Updated to version 2025.1 (2025a) 2025-01-17 11:53:12 +00:00
Derick Rethans
7da1ea4029 Updated to version 2025.1 (2025a) 2025-01-17 11:53:10 +00: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
fecad54d74 Backport fix from PHP 8.3: The exception handler already takes care of destroying the return value 2024-09-13 11:04:45 +01: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
40d06fb645 Import timelib 2022.12 2024-09-11 17:30:57 +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
DanielEScherzer
db545767e5 Rename ZEND_STR_DEPRECATED to ZEND_STR_DEPRECATED_CAPITALIZED (#15831)
To match other capitalized strings like `ZEND_STR_UNKNOWN_CAPITALIZED` and
`ZEND_STR_ARRAY_CAPITALIZED`. Since this known string was only added in PHP
8.4, no backwards compatibility alias is needed.
2024-09-10 22:45:23 +01:00
Derick Rethans
2f3224ea41 Updated to version 2024.2 (2024b) 2024-09-06 12:33:39 +01:00
Derick Rethans
7023fb9d93 Updated to version 2024.2 (2024b) 2024-09-06 12:33:37 +01:00
Derick Rethans
5fc37b1ec6 Updated to version 2024.2 (2024b) 2024-09-06 12:33:36 +01:00
DanielEScherzer
53cb89670c Generated arginfo header files: remove empty zend_function_entry arrays (#15705)
When a class (or enum) has no methods, rather than using an array that only
contains `ZEND_FE_END`, use `NULL` for the functions. The implementation of
class registration for internal classes, `do_register_internal_class()` in
zend_API.c, already skips classes where the functions are `NULL`. By removing
these unneeded arrays, we can reduce the size of the header files, while also
removing an unneeded call to zend_register_functions() for each internal class
with no extra methods.
2024-09-03 23:19:53 +02:00
Máté Kocsis
7dfbf4d1b7 Merge branch 'PHP-8.3'
* PHP-8.3:
  Add missing return for DatePeriod::__unserialize
2024-09-03 21:32:03 +02:00
Máté Kocsis
1663ed6c6e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add missing return for DatePeriod::__unserialize
2024-09-03 21:31:00 +02:00
Máté Kocsis
6cab76986d Add missing return for DatePeriod::__unserialize
Additionally, add other RETURN_THROWS() defensively.
2024-09-03 21:27:50 +02:00