php-src/ext/intl
Dennis Snell f2d8420b1c
Test: grapheme_extract should slide properly past error bytes. (#17404)
grapheme_extract should slide properly past error bytes.

Adds a test to assert that the `$next` parameter of `grapheme_extract()`
points to the next byte offset in the input `$haystack` after accounting
for the moved offset, according to the docs:

> If offset does not point to the first byte of a UTF-8 character,
> the start position is moved to the next character boundary.

It seems that the existing behavior is to find the next grapheme
boundary from the original provided offset, but if the offset doesn’t
point to a valid starting byte, the assigned `$next` value will point
to the byte that was immediately decoded in the same call, leading to
possible infinite loops in user-space code.

```
while ( $at < strlen( $s ) ) {
        $grapheme = grapheme_extract( "\x85PHP", 1, GRAPHEME_EXTR_COUNT, $at, $at );
	// never moves past the second byte, always returns 'P'
}
```
2025-01-17 17:12:41 +09:00
..
breakiterator Merge branch 'PHP-8.3' into PHP-8.4 2025-01-04 17:49:39 +01:00
calendar Use zend_object_alloc() in ext/intl (#17392) 2025-01-07 21:24:24 +01:00
collator Merge branch 'PHP-8.3' into PHP-8.4 2024-11-04 16:02:31 +01:00
common Use zend_object_alloc() in ext/intl (#17392) 2025-01-07 21:24:24 +01:00
converter ext/intl: Refactor internal callable handling for UConverter (#16749) 2024-11-11 14:16:12 +00:00
dateformat Fix registration of internal readonly child classes (#15459) 2024-08-24 12:36:54 +02:00
formatter Close GH-16659: Bump ICU requirement to ICU >= 57.1 2024-11-14 01:30:48 +01:00
grapheme Test: grapheme_extract should slide properly past error bytes. (#17404) 2025-01-17 17:12:41 +09:00
idn Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
locale Fix registration of internal readonly child classes (#15459) 2024-08-24 12:36:54 +02:00
msgformat Fix registration of internal readonly child classes (#15459) 2024-08-24 12:36:54 +02:00
normalizer Close GH-16659: Bump ICU requirement to ICU >= 57.1 2024-11-14 01:30:48 +01:00
resourcebundle Fix registration of internal readonly child classes (#15459) 2024-08-24 12:36:54 +02:00
spoofchecker Fix registration of internal readonly child classes (#15459) 2024-08-24 12:36:54 +02:00
tests Test: grapheme_extract should slide properly past error bytes. (#17404) 2025-01-17 17:12:41 +09:00
timezone ext/intl: Remove unused variable 2025-01-07 23:34:22 +00:00
transliterator Fix registration of internal readonly child classes (#15459) 2024-08-24 12:36:54 +02:00
uchar Close GH-16659: Bump ICU requirement to ICU >= 57.1 2024-11-14 01:30:48 +01:00
config.m4 Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612) 2024-08-29 00:44:29 +02:00
config.w32 Merge branch 'PHP-8.3' into PHP-8.4 2024-12-07 15:11:40 +01:00
CREDITS
ERROR_CONVENTIONS.md Use RETURN_THROWS() during ZPP in most of the extensions 2019-12-31 11:46:11 +01:00
intl_common.h Avoid make_printable_zval() in intl collator 2021-06-10 10:12:47 +02:00
intl_convert.c Preferably include from build dir (#13516) 2024-06-26 00:26:43 +02:00
intl_convert.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
intl_convertcpp.cpp ext/intl: intl_CharFromString using zend_string_truncate to adjust th… (#11575) 2023-07-03 16:41:20 +01:00
intl_convertcpp.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
intl_cppshims.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
intl_data.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
intl_error.c Preferably include from build dir (#13516) 2024-06-26 00:26:43 +02:00
intl_error.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_intl.c Replace @deprecated by #[\Deprecated] for internal functions / class constants (#14750) 2024-07-10 16:47:31 +02:00
php_intl.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_intl.stub.php Close GH-16659: Bump ICU requirement to ICU >= 57.1 2024-11-14 01:30:48 +01:00
php_intl_arginfo.h Close GH-16659: Bump ICU requirement to ICU >= 57.1 2024-11-14 01:30:48 +01:00