php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78308 IntlPartsIterator key is off by one when created with KEY_LEFT
Submitted: 2019-07-17 19:24 UTC Modified: 2021-12-07 22:37 UTC
From: smokey101stair at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: I18N and L10N related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: smokey101stair at gmail dot com
New email:
PHP Version: OS:

 

 [2019-07-17 19:24 UTC] smokey101stair at gmail dot com
Description:
------------
When creating an IntlPartsIterator with a key_type of IntlPartsIterator::KEY_LEFT, the returned key value is off by one after the first key. So for the string "ABC" you would get 0, 2, 3, instead of the expected 0, 1, 2.

Test script:
---------------
https://3v4l.org/O8374


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-18 18:24 UTC] smokey101stair at gmail dot com
Looks like passing IntlPartsIterator::KEY_RIGHT also exhibits the same problem.

https://3v4l.org/SNUAX
 [2019-07-20 11:24 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2019-07-20 13:51 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #78308: IntlPartsIterator key is wrong for KEY_LEFT/KEY_RIGHT
On GitHub:  https://github.com/php/php-src/pull/4446
Patch:      https://github.com/php/php-src/pull/4446.patch
 [2021-11-11 11:18 UTC] nikic@php.net
-Package: intl +Package: I18N and L10N related
 [2021-12-07 22:37 UTC] cmb@php.net
-Status: Verified +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2021-12-07 22:37 UTC] cmb@php.net
Closing as duplicate of <https://github.com/php/php-src/issues/7734>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 12:01:31 2024 UTC