php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34757 iconv_substr() gives "Unknown error" when offset > string length = 1
Submitted: 2005-10-06 14:11 UTC Modified: 2005-10-11 16:00 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: shagren at ua dot fm Assigned:
Status: Closed Package: ICONV related
PHP Version: 5CVS-2005-10-07 (cvs) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shagren at ua dot fm
New email:
PHP Version: OS:

 

 [2005-10-06 14:11 UTC] shagren at ua dot fm
Description:
------------
For some "small"(or empty) stringes iconv_substr produce error when try to use offset > strlen

Reproduce code:
---------------
<?php
  $x = iconv_substr("a",3,2);
  var_dump($x);
?>

Expected result:
----------------
bool(false)



Actual result:
--------------
PHP Notice:  iconv_substr(): Unknown error (0) in C:\temp\1.php on line 2

Notice: iconv_substr(): Unknown error (0) in C:\temp\1.php on line 2

bool(false)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-07 09:40 UTC] sniper@php.net
I got the same result. ICONV is glibc 2.3.5 implementation.

 [2005-10-11 16:00 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 00:01:41 2024 UTC