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

From: Date: Sat, 23 Dec 2000 21:37:02 +0000
Subject: Re: PHP 4.0 Bug #8363: XML parser dies if character_data_handler set
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-42185@lists.php.net to get a copy of this message
On Thu, Dec 21, 2000 at 07:46:56PM -0000, bill@rsv.ricoh.com wrote: > From: bill@rsv.ricoh.com > Operating system: RH Linux 6.2 > PHP version: 4.0.4 > PHP Bug Type: XML related > Bug description: XML parser dies if character_data_handler set i'll commit a fix soon. > > 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); > > > > -- > Edit Bug report at: http://bugs.php.net/?id=8363&edit=1 > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.dev (#42185) next »