grapheme_substr() returns false if length parameter is to large
| Bug #55562 | grapheme_substr() returns false if length parameter is to large | ||||
|---|---|---|---|---|---|
| Submitted: | 2011-09-01 13:19 UTC | Modified: | 2011-09-04 18:50 UTC | ||
| From: | thomas at weinert dot info | Assigned: | stas (profile) | ||
| Status: | Closed | Package: | I18N and L10N related | ||
| PHP Version: | 5.3.8 | OS: | Windows | ||
| Private report: | No | CVE-ID: | None | ||
[2011-09-01 13:19 UTC] thomas at weinert dot info
Description:
------------
If the input string contains multibyte characters and the length argument is greater then the possible maximum length of the result the function returns false.
Test script:
---------------
<?php
var_dump(
grapheme_substr('FOK', 1, 20), // expected: OK
grapheme_substr('한국어', 1, 20) //expected: 국어
);
Expected result:
----------------
string(2) "OK"
string(6) "국어"
Actual result:
--------------
string(2) "OK"
bool(false)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2011-09-04 17:14 UTC] pajoye@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: stas
[2011-09-04 17:14 UTC] pajoye@php.net
[2011-09-04 18:50 UTC] stas@php.net
-Status: Assigned +Status: Closed
[2011-09-04 18:50 UTC] stas@php.net