From: Alex Dowad Date: Mon, 16 Nov 2020 19:16:24 +0000 (+0200) Subject: Bugfixes for findInvalidChars (helper for mbstring test suite) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b489c1bc4d3a6c8abfc410bcdbf0aeb7ffc00246;p=php Bugfixes for findInvalidChars (helper for mbstring test suite) --- diff --git a/ext/mbstring/tests/encoding_tests.inc b/ext/mbstring/tests/encoding_tests.inc index e95bc8fd09..2993640c19 100644 --- a/ext/mbstring/tests/encoding_tests.inc +++ b/ext/mbstring/tests/encoding_tests.inc @@ -158,7 +158,7 @@ function findInvalidChars($valid, &$invalid, &$truncated, $startBytes = array()) $prefixes[substr($char, 0, $len)] = true; } - $varLength = function($prefix) use($valid, &$invalid, &$truncated) { + $varLength = function($prefix) use($valid, $prefixes, &$invalid, &$truncated, &$varLength) { for ($byte = 0; $byte < 256; $byte++) { $str = $prefix . chr($byte); if (!isset($valid[$str])) { @@ -172,7 +172,7 @@ function findInvalidChars($valid, &$invalid, &$truncated, $startBytes = array()) } }; - $fixedLength = function($prefix, $remaining) use($valid, &$invalid, &$truncated, &$fixedLength) { + $fixedLength = function($prefix, $remaining) use($valid, $prefixes, &$invalid, &$truncated, &$fixedLength) { if ($remaining == 0) { if (!isset($valid[$prefix])) $invalid[$prefix] = true;