From: teracci2002 at yahoo dot co dot jp
Operating system: Linux
PHP version: 5.2.1
PHP Bug Type: mbstring related
Bug description: mb_check_encoding fails to check invalid string
Description:
------------
mb_check_encoding returns true when specific invalid EUC-JP / Shift_JIS /
UTF-8 char sequence supplied.
Reproduce code:
---------------
//(1)
var_dump(mb_check_encoding("\x00\xA1", "EUC-JP"));
//(2)
var_dump(mb_check_encoding("\x00\x81", "Shift_JIS"));
//(3)
var_dump(mb_check_encoding("\x00\xE3", "UTF-8"));
Expected result:
----------------
//(1)
bool(false)
//(2)
bool(false)
//(3)
bool(false)
Actual result:
--------------
//(1)
bool(true)
//(2)
bool(true)
//(3)
bool(true)
--
Edit bug report at http://bugs.php.net/?id=41147&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41147&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41147&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41147&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41147&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41147&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41147&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41147&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41147&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41147&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41147&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41147&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41147&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41147&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41147&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41147&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41147&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41147&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41147&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41147&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41147&r=mysqlcfg