Skip to content

ext/intl: Fix grapheme_strstr() and grapheme_strpos() missing canonically equivalent matches - #24029

Merged
LamentXU123 merged 4 commits into
php:PHP-8.4from
LamentXU123:grapheme_fix_2
Oct 1, 2026
Merged

LamentXU123 merged 4 commits into
php:PHP-8.4from
LamentXU123:grapheme_fix_2

Conversation

@LamentXU123

@LamentXU123 LamentXU123 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member
<?php
var_dump(grapheme_strstr("e\u{0301}", "\u{00E9}"));
// now: bool(false)
// expected: string(3) "é"

These two bugs (and #24028) are the two I immediately spotted after I looked into the code base while fixing #24012. So, there may be more bugs.

@devnexen

Copy link
Copy Markdown
Member

it seems grapheme_strpos has a similar bug ?

@LamentXU123

Copy link
Copy Markdown
Member Author

Yeah true.

@LamentXU123 LamentXU123 changed the title ext/intl: Fix grapheme_strstr() missing canonically equivalent matches ext/intl: Fix grapheme_strstr() and grapheme_strpos() missing canonically equivalent matches Sep 30, 2026
@devnexen

Copy link
Copy Markdown
Member

I think it s worth checking.

@LamentXU123

Copy link
Copy Markdown
Member Author

Hence if we got an empty haystack we should reject it in php side so we prevent passing it to ICU wdyt? (which is the implementation now)

@devnexen

Copy link
Copy Markdown
Member

so it might be best to do it once in grapheme_strpos_utf16 ?

@LamentXU123
LamentXU123 merged commit 16a62e3 into php:PHP-8.4 Oct 1, 2026
18 checks passed
LamentXU123 added a commit that referenced this pull request Oct 1, 2026
* PHP-8.6:
  Merge branch 'PHP-8.5' into PHP-8.6

* codex/pr24029-php86:
  ext/intl: Fix grapheme_strstr() and grapheme_strpos() missing canonically equivalent matches (#24029)
t0ny4 pushed a commit to t0ny4/php-src that referenced this pull request Oct 1, 2026
* PHP-8.4:
  ext/intl: Fix grapheme_strstr() and grapheme_strpos() missing canonically equivalent matches (php#24029)
t0ny4 pushed a commit to t0ny4/php-src that referenced this pull request Oct 1, 2026
* PHP-8.5:
  Merge branch 'PHP-8.4' into PHP-8.5

* codex/pr24029-php85:
  ext/intl: Fix grapheme_strstr() and grapheme_strpos() missing canonically equivalent matches (php#24029)
LamentXU123 added a commit that referenced this pull request Oct 1, 2026
Keep master unchanged; the NEWS entry applies to maintenance releases.

* PHP-8.6:
  [skip ci] Merge branch 'PHP-8.5' into PHP-8.6

* codex/pr24029-news-php86:
  [skip ci] NEWS entry for #24029
ndossche pushed a commit to ndossche/php-src that referenced this pull request Oct 1, 2026
ndossche pushed a commit to ndossche/php-src that referenced this pull request Oct 1, 2026
* PHP-8.4:
  [skip ci] NEWS entry for php#24029
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