mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
* MFH: Fix bug #45239 (encoding detector hangs with mbstring.strict_detection
enabled).
This commit is contained in:
parent
bddaa8fc4a
commit
44dece2d95
@ -462,10 +462,9 @@ enum mbfl_no_encoding mbfl_encoding_detector_judge(mbfl_encoding_detector *ident
|
||||
while (n >= 0) {
|
||||
filter = identd->filter_list[n];
|
||||
if (!filter->flag) {
|
||||
if (identd->strict && filter->status) {
|
||||
continue;
|
||||
if (!identd->strict || !filter->status) {
|
||||
encoding = filter->encoding->no_encoding;
|
||||
}
|
||||
encoding = filter->encoding->no_encoding;
|
||||
}
|
||||
n--;
|
||||
}
|
||||
|
18
ext/mbstring/tests/bug45239.phpt
Normal file
18
ext/mbstring/tests/bug45239.phpt
Normal file
@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #45239 (encoding detector hangs with mbstring.strict_detection enabled)
|
||||
--INI--
|
||||
mbstring.strict_detection=1
|
||||
mbstring.http_input=UTF-8
|
||||
mbstring.internal_encoding=UTF-8
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('mbstring') or die('skip');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
mb_internal_encoding("utf-8");
|
||||
mb_parse_str("a=%fc", $dummy);
|
||||
var_dump(mb_http_input());
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "UTF-8"
|
Loading…
Reference in New Issue
Block a user