php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48538 iconv_strlen() does not reject invalid charset on PHP6
Submitted: 2009-06-12 18:17 UTC Modified: 2010-06-20 23:53 UTC
From: wharmby at uk dot ibm dot com Assigned:
Status: Wont fix Package: ICONV related
PHP Version: 6CVS-2009-06-12 (snap) OS: Win XP Pro
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-06-12 18:17 UTC] wharmby at uk dot ibm dot com
Description:
------------
The PHP 6 version of iconv_strlen() does not raise a notice when a invalid charset is specified for the optional charset argument

Similar issue with iconv_strpos(). 

Reproduce code:
---------------
<?php
	$string = 'abcdef';
	$encoding = 'unknown-encoding';
	var_dump(iconv_strlen($string, $encoding));
?>


Expected result:
----------------
bool(false)
PHP Notice:  iconv_strlen(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in ...

Actual result:
--------------
int(6)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-12 19:01 UTC] wharmby at uk dot ibm dot com
Two new PHP 6 tests dropped which are tagged as XFAIL until this defect resolved. They are


ext/iconv/tests/iconv_strlen_variation2.phpt
ext/iconv/tests/iconv_strpos_error_2.phpt
 [2010-06-20 23:53 UTC] felipe@php.net
-Status: Open +Status: Wont fix
 [2010-06-20 23:53 UTC] felipe@php.net
This just occurred in the old trunk version.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC