RE: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a page that uses xml parser.

From: Date: Wed, 03 Jan 2001 13:05:56 +0000
Subject: RE: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a page that uses xml parser.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-42800@lists.php.net to get a copy of this message
Jani, I think unless this is already in 404 tree then it will be in 4.0.5, the only patches to be in 4.0.4pl1 should be Zeevs to mod_php4.c to fix the two issues mentioned before. James > -----Original Message----- > From: sniper@php.net [mailto:sniper@php.net] > Sent: 03 January 2001 12:41 > To: php-dev@lists.php.net > Subject: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a > page that uses xml parser. > > > ID: 8425 > Updated by: sniper > Reported By: kirys@kt2k.com > Old-Status: Open > Status: Closed > Bug Type: Reproduceable crash > Assigned To: > Comments: > > This is fixed in CVS. Wait for PHP 4.0.4pl1 to be released. > > --Jani > > Previous Comments: > ------------------------------------------------------------------ > --------- > > [2000-12-26 12:09:27] kirys@kt2k.com > The same script doesn't crash if used under v4.0.3 > no additional modules used > The page MUST be included in a php file > > > Script Source code: > <?php > echo "."; > $file = "xml/links.xml"; > $depth = array(); > function startElement($parser, $name, $attrs) { > global $depth; > // for ($i = 0; $i < $depth[$parser]; $i++) {} > switch ($name){ > case "LINKPAGE"; > print"<TABLE WIDTH="98%" CELLSPACING=2 CELLPADDING=1 > BORDER=0>n"; > print"<TR BGCOLOR="Blue"><TD > CLASS="ListTitle2">Title</TD><TD > CLASS="ListTitle2">Vote</TD><TD > CLASS="ListTitle2">Comments</TD></TR>n"; > break; > case "LINK": > print "<TR><TD CLASS="ListTitle2"><A CLASS="Menu" > > HREF="".$attrs["URL"]."">".$attrs["TITLE"]."</A></TD>"; > print "<TD BGCOLOR="Silver" > ALIGN="CENTER">".$attrs["VOTE"]."</TD><TD > BGCOLOR="Silver">"; > break; > case "SECTION": > print "<TR><TD CLASS="ListTitle" COLSPAN=3><CENTER>"; > break; > default: > print "<TD>"; > > } > > $depth[$parser]++; > } > > function endElement($parser, $name) { > global $depth; > switch ($name){ > case "LINKPAGE"; > print"<TR><TD Class="ListNote" COLSPAN=3>"; > print"<B>Notes</B><BR>"; > print"?/10: Means that I didn't decided a vote for > that site yet"; > print"</TD></TR>"; > print"</TABLE>n"; > break; > case "SECTION": > print "</CENTER></TD></TR>"; > break; > case "LINK": > echo"</TD></TR>"; > break; > default: > echo"</TD></TR>n"; > > } > $depth[$parser]--; > } > > function characterData($parser, $data) { > print "$data"; > } > > echo "."; > $xml_parser = xml_parser_create(); > echo "."; > xml_set_element_handler($xml_parser, "startElement", > "endElement"); > echo "."; > xml_set_character_data_handler($xml_parser, "characterData"); > if (!($fp = fopen($file, "r"))) { > die("could not open XML input"); > } > > while ($data = fread($fp, 4096)) { > if (!xml_parse($xml_parser, $data, feof($fp))) { > die(sprintf("XML error: %s at line %d", > > xml_error_string(xml_get_error_code($xml_parser)), > xml_get_current_line_number($xml_parser))); > } > } > xml_parser_free($xml_parser); > > > ?> > > > ------------------------------------------------------------------ > --------- > > > Full Bug description available at: http://bugs.php.net/?id=8425 > > > -- > 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 (#42800) next »