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

2637 Commits

Author SHA1 Message Date
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
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
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
0c8a7a77a8 Updated to version 2025.2 (2025b) 2025-03-24 10:06:32 +00: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
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
7da1ea4029 Updated to version 2025.1 (2025a) 2025-01-17 11:53:10 +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
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
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
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
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
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
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
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
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
Peter Kokot
f702437cad Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Append -Wno-implicit-fallthrough flag conditionally (#13331)
2024-07-22 06:58:01 +02:00
Peter Kokot
d20d11375f Append -Wno-implicit-fallthrough flag conditionally (#13331)
Older GCC versions (< 7.0) don't support the -Wno-implicit-fallthrough
compiler flag. This adds the flag conditionally in case some other
compiler will run into same issue.

Fixes GH-13330
2024-07-22 06:57:04 +02:00
Matteo Beccati
5373f5dd9d Fix test on non-UTC environments 2024-02-19 15:18:48 +01:00
Derick Rethans
0dea244999 Updated to version 2024.1 (2024a) 2024-02-02 10:23:35 +00:00
Derick Rethans
7d5a96614c Updated to version 2024.1 (2024a) 2024-02-02 10:23:33 +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
Derick Rethans
9f3e120dc0 Updated to version 2023.4 (2023d) 2024-01-02 10:21:28 +00:00
Derick Rethans
99be8b05ae Updated to version 2023.4 (2023d) 2024-01-02 10:21:27 +00:00
Derick Rethans
2e4b660b27 Merge branch 'PHP-8.2' into PHP-8.3 2023-11-23 16:18:43 +00:00
Derick Rethans
28dabaab2f Import timelib 2022.10 2023-11-23 16:06:00 +00:00
Ayesh Karunaratne
27fb8d1c0c Fix DateTime exception hierarchy for DateInvalidTimeZoneException (#11970)
`DateInvalidTimeZoneException` is supposed to inherit from `DateException`, but the current stub has `Exception`.
2023-08-14 18:55:38 +02:00
Niels Dossche
17b3af2958 GH-11964: In ext/date/php_date.stub.php, DateRangeError extends itself
According to the RFC[1] it's supposed to extend DateError.

[1] https://wiki.php.net/rfc/datetime-exceptions
2023-08-14 13:57:09 +02:00
Derick Rethans
1bddd4ef44 Merge branch 'PHP-8.2' 2023-08-10 12:11:35 +01:00
Derick Rethans
e157da11f3 Update initialisation check for new PHP-8.3 API 2023-08-09 20:12:41 +01:00
Derick Rethans
b71d2e16e6 Fix GH-11416: Crash with DatePeriod when uninitialised objects are passed in (PHP 8.2+) 2023-08-09 16:10:14 +01:00
Derick Rethans
f8b42da3a4 Merge branch 'PHP-8.2' 2023-08-09 15:39:31 +01:00
Derick Rethans
7f6e98cec7 Merge branch 'PHP-8.1' into PHP-8.2 2023-08-09 15:39:25 +01:00
Derick Rethans
4833b84854 Fix GH-11416: Crash with DatePeriod when uninitialised objects are passed in 2023-08-09 15:39:13 +01:00
Derick Rethans
a33dfd2cd9 Merge branch 'PHP-8.2' 2023-08-03 09:53:16 +01:00
Derick Rethans
a8f4171655 Fixed bug GH-11854 (DateTime:createFromFormat stopped parsing datetime with extra space) 2023-08-03 09:52:34 +01:00
Derick Rethans
851890bd9c Import timelib 2022.09 2023-08-03 09:42:31 +01:00
Derick Rethans
82ff4c5e84 Make the new DatePeriod::createFromISO8601String method emit DateTimeImmutable objects 2023-07-25 18:43:45 +01:00