Index: ext/xml/compat.c =================================================================== RCS file: /repository/php-src/ext/xml/compat.c,v retrieving revision 1.32.2.7 diff -u -r1.32.2.7 compat.c --- ext/xml/compat.c 17 Dec 2004 12:21:34 -0000 1.32.2.7 +++ ext/xml/compat.c 17 Feb 2005 11:12:08 -0000 @@ -379,8 +379,6 @@ } if (encoding != NULL) { parser->parser->encoding = xmlStrdup(encoding); - } else { - parser->parser->charset = XML_CHAR_ENCODING_NONE; } parser->parser->replaceEntities = 1; parser->parser->wellFormed = 0; Index: ext/xml/tests/bug32001.phpt =================================================================== RCS file: ext/xml/tests/bug32001.phpt diff -N ext/xml/tests/bug32001.phpt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ext/xml/tests/bug32001.phpt 17 Feb 2005 11:12:08 -0000 @@ -0,0 +1,40 @@ +--TEST-- +Bug #32001 (infinite loop in libxml character encoding detection) +--FILE-- +simple note"; +xml_parse_into_struct($myparser, $simple, $myvals, $mytags); +var_dump($myvals); +--EXPECT-- +array(3) { + [0]=> + array(3) { + ["tag"]=> + string(4) "PARA" + ["type"]=> + string(4) "open" + ["level"]=> + int(1) + } + [1]=> + array(4) { + ["tag"]=> + string(4) "NOTE" + ["type"]=> + string(8) "complete" + ["level"]=> + int(2) + ["value"]=> + string(11) "simple note" + } + [2]=> + array(3) { + ["tag"]=> + string(4) "PARA" + ["type"]=> + string(5) "close" + ["level"]=> + int(1) + } +}