Date: 01/03/01
- Next message: James Moore: "RE: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a page that uses xml parser."
- Previous message: Marc Boeren: "[PHP-DEV] 'while'-like user functions in a module?"
- Next in thread: James Moore: "RE: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a page that uses xml parser."
- Reply: James Moore: "RE: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a page that uses xml parser."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 8425
Updated by: sniper
Reported By: kirys <email protected>
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 <email protected>
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 <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: James Moore: "RE: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a page that uses xml parser."
- Previous message: Marc Boeren: "[PHP-DEV] 'while'-like user functions in a module?"
- Next in thread: James Moore: "RE: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a page that uses xml parser."
- Reply: James Moore: "RE: [PHP-DEV] PHP 4.0 Bug #8425 Updated: PHP crashes if I include a page that uses xml parser."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

