Skip to content

Allow empty needle in grapheme_str*() functions #20

Closed

Description

@kocsismate

Currently, string functions in ext/standard and ext/mbstring can accept an empty $needle, so we should add support for this in ext/intl as well.

The relevant code that needs to be changed is https://github.com/unicode-org/icu/blob/f744742e036441cbfd54b535e722dc3801ff0f63/icu4c/source/i18n/usearch.cpp#L2675. Discussion: php/php-src#5972 (comment)

Activity

  1. chschneider commented on Sep 30, 2020

    @chschneider

    I made a patch to allow empty needles by explicitly checking in grapheme_strpos_utf16.

    See
    php/php-src@master...chschneider:grapheme_empty_needles
    for the diff, should I submit a pull request or are there major issues with this approach?

  2. nikic commented on Sep 30, 2020

    @nikic
    Member

    @chschneider Looks reasonable

  3. added a commit that references this issue on Oct 1, 2020
    7af24ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions