Skip to content

ext/intl: Fix grapheme_strstr() and grapheme_stristr() match offsets … - #24012

Merged
LamentXU123 merged 2 commits into
php:PHP-8.4from
LamentXU123:intl-fix-
Sep 30, 2026
Merged

LamentXU123 merged 2 commits into
php:PHP-8.4from
LamentXU123:intl-fix-

Conversation

@LamentXU123

Copy link
Copy Markdown
Member

…after supplementary characters

<?php
$s = "\u{1F600}abc"; // 😀abc

var_dump(grapheme_strstr($s, 'a'));
// now return: "bc"; should return: "abc"

var_dump(grapheme_strstr($s, 'a', true));
// now return: "😀a"; should return: "😀"

Same stuff also happens on grapheme_stristr

@LamentXU123
LamentXU123 merged commit f2a59c1 into php:PHP-8.4 Sep 30, 2026
1 of 2 checks passed
bukka pushed a commit to bukka/php-src that referenced this pull request Sep 30, 2026
* PHP-8.4:
  ext/intl: Fix grapheme_strstr() and grapheme_stristr() match offsets after supplementary characters (php#24012)
bukka added a commit to bukka/php-src that referenced this pull request Sep 30, 2026
* upstream/master: (34 commits)
  Remove the mysqlnd_reverse_api feature (php#21409)
  ext/intl: Fix grapheme_strstr() and grapheme_stristr() match offsets after supplementary characters (php#24012)
  pdo: refactor pdo_stmt_construct() to use zend_object* rather than zval* (php#24019)
  Zend: Skip frameless registration for temporary modules
  ext/curl/config.m4: include string.h for test using strncmp()
  ext/soap/tests/bugs/bug62900.phpt: make use of TEST_PHP_ vars
  sapi/cli/tests/php_cli_server_ipv6_error_message.phpt: use TEST_PHP_ vars
  Zend/tests: organize some tests with sub directories (11) (php#22731)
  zend_hrtime: remove zend_hrtime_posix_clock_id (php#24016)
  Zend/lazy_objects: add const qualifiers
  Zend: use zend_get_gc_buffer_add_fcc for lazy objects
  Zend: use uint32_t type for lazy_properties_count
  reflection: mark reflection_class_new_lazy as static always inline
  reflection: use ZEND_FCC_INITIALIZED macro for lazy objects
  Zend/lazy_objects: drop variable which is used once
  Zend: use zend_object* parameter type instead of zval* for closure API (php#24015)
  Fix HashTable UAF when rebound from a parameter __toString()
  Fix phpGH-22051: report errors from SQLite3Result reset and finalize
  Update IR (php#24013)
  Fix array_map optimization with non-literal function or non-literal args (php#23254)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants