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

From: Date: Sat, 04 Aug 2018 02:07:04 +0000
Subject: Bug #76704 [Opn->Ana]: mb_detect_order return value varies based on argument type
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216574@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: yohgaki@php.net Reported by: smokey101stair at gmail dot com Summary: mb_detect_order return value varies based on argument type -Status: Open +Status: Analyzed Type: Bug Package: mbstring related -Operating System: Windows 10 +Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#216574) next »