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: 2019-07-20 11:24 UTC
From: smokey101stair at gmail dot com Assigned:
Status: Verified Package: intl (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
40 + 3 = ?
Subscribe to this entry?

 
 [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
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 03:01:24 2020 UTC