* MFH: Fix bug #45239 (encoding detector hangs with mbstring.strict_detection

enabled).
This commit is contained in:
Moriyoshi Koizumi 2009-02-06 07:33:25 +00:00
parent bddaa8fc4a
commit 44dece2d95
2 changed files with 20 additions and 3 deletions

View File

@ -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--;
}

View 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"