Bug #76704 [Ana->Csd]: mb_detect_order return value varies based on argument type

From: Date: Sat, 04 Aug 2018 12:24:20 +0000
Subject: Bug #76704 [Ana->Csd]: mb_detect_order return value varies based on argument type
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216578@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76704&edit=1 ID: 76704 Updated by: cmb@php.net Reported by: smokey101stair at gmail dot com Summary: mb_detect_order return value varies based on argument type -Status: Analyzed +Status: Closed Type: Bug Package: mbstring related Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=c00f5e6531a3f72bb8f7c107d2c390fadad736a0 Log: Fix #76704: mb_detect_order return value varies based on argument type Previous Comments: ------------------------------------------------------------------------ [2018-08-04 02:07:04] yohgaki@php.net 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 00:13:05] smokey101stair at gmail dot com Description: ------------ 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: --------------- https://3v4l.org/gJfAO 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76704&edit=1

« previous php.bugs (#216578) next »