|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76704 mb_detect_order return value varies based on argument type
Submitted: 2018-08-04 00:13 UTC Modified: 2018-08-04 12:24 UTC
From: smokey101stair at gmail dot com Assigned: cmb (profile)
Status: Closed Package: mbstring related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2018-08-04 00:13 UTC] smokey101stair at gmail dot com
The function mb_detect_order() can receive either a comma separated list of encodings or an array of encodings. However, its return value varies based on whether it is given a string or an array that contain the same values.

Test script:

Expected result:
mb_detect_order() should return the same value regardless of which type is used for the encoding_list parameter. HHVM seems to not be affected by this.

Actual result:
When given a string, mb_detect_order() will return true if it finds at least one supported encoding in the list.

When given an array, mb_detect_order() will return false if it finds any non-supported encoding.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-04 02:07 UTC]
-Status: Open +Status: Analyzed -Operating System: Windows 10 +Operating System: Irrelevant
 [2018-08-04 02:07 UTC]
mb_detect_order() logic is broken and needed to be fixed.
It doesn't work as it should with multiple encodings since it is implemented.
 [2018-08-04 12:24 UTC]
Automatic comment on behalf of
Log: Fix #76704: mb_detect_order return value varies based on argument type
 [2018-08-04 12:24 UTC]
-Status: Analyzed +Status: Closed
 [2018-08-04 12:24 UTC]
-Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 08:01:31 2024 UTC