From b489c1bc4d3a6c8abfc410bcdbf0aeb7ffc00246 Mon Sep 17 00:00:00 2001 From: Alex Dowad Date: Mon, 16 Nov 2020 21:16:24 +0200 Subject: [PATCH] Bugfixes for findInvalidChars (helper for mbstring test suite) --- ext/mbstring/tests/encoding_tests.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.40.0