|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68842 mb_check_encoding() behavior does not check all HTTP inputs
Submitted: 2015-01-16 02:36 UTC Modified: 2017-10-24 03:07 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: Assigned: yohgaki (profile)
Status: Assigned Package: mbstring related
PHP Version: Irrelevant OS: Irerelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
17 + 33 = ?
Subscribe to this entry?

 [2015-01-16 02:36 UTC]


The byte stream to check. If it is omitted, this function checks all the input from the beginning of the request.

This description is misleading. What mbstring does is 

Return TRUE if all conversions since the execution of the script has no problems at all. Return FALSE if there is any conversion errors in mbstring operations.

If input encoding conversion is done, all inputs (GPC) are converted from mbstring.http_input encoding to mbstring.internal_encoding. If input encoding conversion is not done, it cannot be used for input encoding checks.

I think it's better to check GET/POST/COOKIE encodings, but it was made this way since the introduction, I guess. (I think 1st param was not optional at first, but I don't remember well.)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-25 02:34 UTC]
-Assigned To: +Assigned To: yohgaki
 [2015-12-18 10:02 UTC]
Automatic comment from SVN on behalf of yohgaki
Log: Fix bug #68842 mb_check_encoding() behavior does not match document
 [2015-12-18 10:02 UTC]
-Status: Assigned +Status: Closed
 [2015-12-19 23:23 UTC]
-Summary: mb_check_encoding() behavior does not match document +Summary: mb_check_encoding() behavior does not check all HTTP inputs -Status: Closed +Status: Re-Opened -Type: Documentation Problem +Type: Bug
 [2015-12-19 23:23 UTC]
Rather than change old doc. It's better to change mb_check_encoding() behavior to documented way.
 [2017-10-24 03:07 UTC]
-Status: Re-Opened +Status: Assigned
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 16:01:24 2019 UTC