php.net |  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
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: yohgaki@php.net Assigned: yohgaki (profile)
Status: Closed Package: mbstring related
PHP Version: Irrelevant OS: Irerelevant
Private report: No CVE-ID: None
 [2015-01-16 02:36 UTC] yohgaki@php.net
Description:
------------
http://php.net/mb_check_encoding

says,

var
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.)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-25 02:34 UTC] yohgaki@php.net
-Assigned To: +Assigned To: yohgaki
 [2015-12-18 10:02 UTC] yohgaki@php.net
Automatic comment from SVN on behalf of yohgaki
Revision: http://svn.php.net/viewvc/?view=revision&revision=338292
Log: Fix bug #68842 mb_check_encoding() behavior does not match document
 [2015-12-18 10:02 UTC] yohgaki@php.net
-Status: Assigned +Status: Closed
 [2015-12-19 23:23 UTC] yohgaki@php.net
-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] yohgaki@php.net
Rather than change old doc. It's better to change mb_check_encoding() behavior to documented way.
 [2017-10-24 03:07 UTC] kalle@php.net
-Status: Re-Opened +Status: Assigned
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=456e9a04a667359e22e0f68e8dd3b41d3e0993ef
Log: Fix bug #68842 mb_check_encoding() behavior does not match document
 [2020-02-07 06:07 UTC] phpdocbot@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC