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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: yohgaki@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Fri Dec 27 19:01:28 2024 UTC