PHP 4.0 Bug #8363 Updated: XML parser dies if character_data_handler set

From: Date: Sat, 23 Dec 2000 21:48:07 +0000
Subject: PHP 4.0 Bug #8363 Updated: XML parser dies if character_data_handler set
Groups: php.dev 
Request: Send a blank email to php-dev+get-42188@lists.php.net to get a copy of this message
ID: 8363 Updated by: thies Reported By: bill@rsv.ricoh.com Old-Status: Open Status: Closed Bug Type: XML related Assigned To: Comments: fixed in CVS Previous Comments: --------------------------------------------------------------------------- [2000-12-21 14:46:56] bill@rsv.ricoh.com The following test case originally came from the online docs, but most recently from the xml2tree project I wrote (http://www.risource.org/phpTools/xml2tree/ ); two people have reported it broken with the release of 4.0.4. ----------- configuration ----------------- ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs ----------- test case --------- function characterData($parser, $data) { echo "in characterData got [$data]<br>"; } $xml_parser = xml_parser_create(); // commment out the following line to prevent the crash xml_set_character_data_handler($xml_parser, "characterData"); $xmlContent = "<mytag> <othertag> goo </othertag><yuck>glumph</yuck></mytag>"; echo "before data<br>"; flush(); // 4.0.4 dies here, but only if character_data_handler is set; // 4.0.3 is fine. if (!xml_parse($xml_parser, $xmlContent, "yes" )) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } echo "after data<br>"; flush(); xml_parser_free($xml_parser); --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=8363

« previous php.dev (#42188) next »