|  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
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.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [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-2020 The PHP Group
All rights reserved.
Last updated: Thu Jan 23 21:01:24 2020 UTC