Commit graph

1541 commits

Author SHA1 Message Date
Niels Dossche
bf4b470098
Fix reference support for intltz_get_offset()
It should use the helper macros such that types are properly respected.

Closes GH-18364.
2025-04-20 14:23:31 +02:00
Niels Dossche
13d51f895b
Add missing EXTENSIONS section to intl test
[ci skip]
2025-03-31 23:05:15 +02:00
Niels Dossche
8823f89a32
Fix intl tests for icu 77 (#18125) 2025-03-21 14:23:03 +01:00
David Carlier
005c7b5797
ext/intl: Fix Uconverter::transcode with substitutes as references.
close GH-18059
2025-03-15 11:37:08 +00:00
David Carlier
f34859cb90
ext/intl: Fix dateformat_format when the time is an array of references. 2025-03-15 11:33:17 +00:00
David Carlier
c3fc94c4b8
ext/intl: fix locale_compose/locale_lookup to be able to deal with references.
close GH-18035
2025-03-12 22:18:34 +00:00
Christoph M. Becker
76fccc2b02
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:37:21 +01:00
Christoph M. Becker
036f00f146
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:36:39 +01:00
Christoph M. Becker
afe8e2cdff
Relax timezone_IDforWindowsID_basic2.phpt expectations
Apparently, some ICU versions report "America/Los_Angeles" for the `ZZ`
case, what matches the behavior of ICU 76.1 (on Windows).  Possibly,
there has been some bug fix backport on some systems.  Anyhow, either
seems fine, so we're not picky about that.

Closes GH-17669.
2025-02-02 13:35:27 +01:00
David Carlier
a1d1269688
Fix GH-17469: UConverter::transcode() not hardcoding error handling.
Respecting instead intl.use_exceptions/intl.error_level.

close GH-17488
2025-01-17 22:23:27 +00:00
Niels Dossche
ee2faaa423
Handle GC cycles properly in intl iterators
This is a follow-up on GH-17343 to implement GC cycle management.
Previously the objects lived too long due to the strong cycle.
This patch adds get_gc handlers to break the cycle.

Closes GH-17355.
2025-01-04 17:42:18 +01:00
Niels Dossche
a970eefb6c
Fix GH-11874: intl causing segfault in docker images
The segfault happens because zoi->wrapping_obj points to an object that has been freed.
This wrapping_obj is set in IntlIterator_from_StringEnumeration().
Notice how the refcount is not increased in this function.
By switching to ZVAL_OBJ_COPY, the segfault disappears.

We also need to move the responsibility of destroying the iterator to
the iterator itself and keep the object data destruction in the object
destruction. The existing code used a weird recursive destruction
between the iterator and object that was too hard to understand to be
honest. This patch simplifies everything and in the process gets rid of
the leak.

Iterators that are embedded are now responsible for their own
memory cleanup.

Closes GH-17343.
2025-01-03 18:58:15 +01:00
Christoph M. Becker
1800cad9d9
Properly check for required icu4c libraries
Besides that just checking for icuuc.lib does not necessarily imply
that the other libraries are available, doing it this way will not copy
the PDBs to the build folder, so these are not available in the debug
packages.  Furthermore, `CHECK_LIB` already adds the library to the
flags, so there is no need to do this manually.

Closes GH-17010.
2024-12-07 15:10:06 +01:00
Christoph M. Becker
716b03d081
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Adapt ext/intl tests for ICU 75.1 and 76.1
2024-11-15 18:55:31 +01:00
Christoph M. Becker
f725f504e8
Adapt ext/intl tests for ICU 75.1 and 76.1
Closes GH-16788.
2024-11-15 18:55:01 +01:00
Ilija Tovilo
745684290e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Postpone zend_array_sort() in ext-intl
  Use bool for zend_array_sort()
2024-11-04 16:02:16 +01:00
Ilija Tovilo
845cdbce67
Postpone zend_array_sort() in ext-intl
This function is not ZEND_API yet, so we cannot use it as it won't work for
dynamically linked extensions.
2024-11-04 16:01:00 +01:00
Ilija Tovilo
f033cf75e4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix array going away during sorting
2024-11-04 15:51:03 +01:00
Ilija Tovilo
2bdce61390
Fix array going away during sorting
Fixes GH-16648
Closes GH-16654
2024-11-04 15:50:35 +01:00
Christoph M. Becker
ce25be5223
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15087 IntlChar::foldCase()'s $option is not optional
2024-07-24 16:47:03 +02:00
Christoph M. Becker
5fbda73099
Fix GH-15087 IntlChar::foldCase()'s $option is not optional
Since that parameter is supposed to be optional (and has been prior to
PHP 8.0.0), we fix the implementation instead of the stub.

Closes GH-15091.
2024-07-24 16:45:20 +02:00
Niels Dossche
c87f29f685
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix reference handling in SpoofChecker
2024-06-01 20:40:17 +02:00
Niels Dossche
5ec26edfb6
Fix reference handling in SpoofChecker
Closes GH-14414.
2024-06-01 20:35:57 +02:00
Calvin Buckley
d479ac4856 Merge remote-tracking branch 'origin/PHP-8.2' into PHP-8.3 2024-05-10 15:08:25 -03:00
Calvin Buckley
4e21a26db2
Fix check for newer versions of ICU (#14186)
* Fix check for newer versions of ICU

The previous test would always trigger, even if the version of ICU
installed didn't require C++17. This was because it incorrectly used
the `test` program, which broke the build on systems without a C++17
compiler.

Tested with macOS 14 and i 7.2.

* Fix broken ICU version check for definition

Same as the previous fix for C++17.

---------

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-05-10 14:20:17 -03:00
David Carlier
e94f3a7b40
Merge branch 'PHP-8.2' into PHP-8.3 2024-04-19 10:07:11 +01:00
David Carlier
cc46a4e6b5
ext/intl: level up c++ runtime std for icu 74 and onwards.
to align with what is required to build icu 74 itself.

Close GH-14002
2024-04-19 10:04:25 +01:00
Peter Kokot
8d5fc8d23f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Use EXTENSIONS instead of SKIPIF sections in *.phpt
2024-01-31 11:20:44 +01:00
Peter Kokot
218a93b898 Use EXTENSIONS instead of SKIPIF sections in *.phpt
This also fixes skipped tests due to different naming "zend-test"
instead of "zend_test" and "PDO" instead of "pdo":

- ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/zend_test/tests/observer_sqlite_create_function.phpt

EXTENSIONS section is used for the Windows build to load the non-static
extensions.

Closes GH-13276
2024-01-31 11:18:21 +01:00
David Carlier
b32a1cc76f Merge branch 'PHP-8.2' into PHP-8.3 2024-01-03 17:34:54 +00:00
David Carlier
96ffe6ad7e ext/intl: fix bug introduced by 5455c3f
was meant to fix GH-12943.

Close GH-13001.
2024-01-03 17:33:27 +00:00
David Carlier
f20edf0fb3 Merge branch 'PHP-8.2' into PHP-8.3 2023-12-22 17:26:20 +00:00
David Carlier
6a447e7437 GH-12943 ext/intl accept C as acceptable locale argument.
Close GH-12955
2023-12-22 17:26:09 +00:00
Niels Dossche
6641cd159e
Fix GH-12635: Test bug69398.phpt fails with ICU 74.1
ICU 74.1 contains new locale data that breaks the test.
Split the test based on the version number to resolve the issue.

Closes GH-12653.
2023-11-22 20:39:27 -06:00
Niels Dossche
608842b5b7 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12635: Test bug69398.phpt fails with ICU 74.1
2023-11-11 17:04:37 +01:00
Niels Dossche
333cf3c111 Fix GH-12635: Test bug69398.phpt fails with ICU 74.1
ICU 74.1 contains new locale data that breaks the test.
Split the test based on the version number to resolve the issue.

Closes GH-12653.
2023-11-11 17:04:01 +01:00
Ilija Tovilo
677db1b0de
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix timezone dependent test
2023-11-10 12:11:27 +01:00
Ilija Tovilo
d316712baa
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix timezone dependent test
2023-11-10 12:11:17 +01:00
SakiTakamachi
6a43135c1d
Fix timezone dependent test
Closes GH-12637
2023-11-10 12:10:30 +01:00
Dmitry Stogov
22735b3ff5 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
  ext/intl: change when the locale is invalid for the 8.1/8.2 serie.
2023-11-02 08:15:50 +03:00
David Carlier
a39e869b55 Merge branch 'PHP-8.1' into PHP-8.2 2023-11-01 19:13:08 +00:00
David Carlier
0da1356c66 ext/intl: change when the locale is invalid for the 8.1/8.2 serie.
does not throws an exception as it's considered as a too string change,
but the code user still needs to double check.
2023-11-01 19:12:50 +00:00
David Carlier
d9e72bcdab Merge branch 'PHP-8.2' into PHP-8.3 2023-09-23 20:12:56 +01:00
David Carlier
36f78862c8 Merge branch 'PHP-8.1' into PHP-8.2 2023-09-23 20:12:41 +01:00
David Carlier
a80db7b52a Fix GH-12282: IntlDateFormatter::construct should throw an exception is the locale field has an invalid value.
Close GH-12282
2023-09-23 20:12:13 +01:00
David Carlier
35a502f168 Merge branch 'PHP-8.2' into PHP-8.3 2023-09-21 05:35:48 +01:00
David Carlier
63150dc2b1 Merge branch 'PHP-8.1' into PHP-8.2 2023-09-21 05:35:04 +01:00
David Carlier
84c4336aa3 Fix GH-12243, segfault on IntlDateFormatter::construct with dateType set to UDAT_PATTERN but not timeType.
udat_open expects its timeStyle's argument to be set to UDAT_PATTERN
 when dateStyle is, regardless if there an actual pattern or not.

Close GH-12245
2023-09-21 05:34:49 +01:00
George Peter Banyard
b17958e7be Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed bug GH-12020: intl_get_error_message() broken after MessageFormatter::formatMessage() fails
2023-09-03 01:04:59 +01:00
George Peter Banyard
fa0953f49d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed bug GH-12020: intl_get_error_message() broken after MessageFormatter::formatMessage() fails
2023-09-03 01:04:06 +01:00