php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47399 mb_check_encoding returns true with illegal SJIS string
Submitted: 2009-02-16 00:05 UTC Modified: 2009-02-16 01:58 UTC
From: for-bugs at hnw dot jp Assigned: moriyoshi (profile)
Status: Closed Package: mbstring related
PHP Version: 5.2.9RC2 OS: any
Private report: No CVE-ID: None
 [2009-02-16 00:05 UTC] for-bugs at hnw dot jp
Description:
------------
mb_check_encoding returns true when specific invalid "SJIS" or "SJIS-win" string.

Reproduce code:
---------------
<?php

var_dump(mb_check_encoding("\x81\x3A", "SJIS-win"));

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

Actual result:
--------------
bool(true)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-16 00:11 UTC] for-bugs at hnw dot jp
Proposed fix is here: http://hnw.sakura.ne.jp/mb_check_encoding.47399.patch.txt
 [2009-02-16 00:28 UTC] felipe@php.net
Thanks for the patch.

Assigned to maintainer.
 [2009-02-16 01:58 UTC] moriyoshi@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: Tue Mar 19 07:01:29 2024 UTC