Bug #2618 Updated: XML error reporting bug

From: Date: Sun, 16 Jun 2002 18:17:39 +0000
Subject: Bug #2618 Updated: XML error reporting bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10775@lists.php.net to get a copy of this message
ID: 2618 Updated by: sander@php.net Reported By: brad_jackson@inlet.com -Status: Open +Status: Bogus Bug Type: Misbehaving function Operating System: Redhat Linux 5.2/6.0 PHP Version: 3.0.12 New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately, PHP 3 is no longer supported. Please download the latest version of PHP 4 from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: ------------------------------------------------------------------------ [1999-10-27 09:10:42] brad_jackson@inlet.com If there is a mismatched tag in XML and the parsing fails, when calling xml_get_current_line_number or xml_get_current_column_number, the results are not consistent between runs. Here's a code sample and results. I've noticed that if I initialize $done to FALSE, it doesn't happen, but I don't know how that could be related. I also tried shortening the XML sample, but then it doesn't happen either. I've seen XML errors in the past that would cause Apache to seg fault when calling the functions to get details about the XML error and this may be the same problem. <?php $xml = "<ABCDEFGH>\n<ABCDEFGHIJKLM>1234567890</ABCDEFGHIJKLM>\n<ABCDEFGH>"; // Note last closing tag should be "</ABCDEFGH>" while(!$done) { for($i = 0; $i < 2; $i++) { $xmlParser = xml_parser_create(); xml_parse($xmlParser, $xml, TRUE); $pass[$i]["Line"] = xml_get_current_line_number($xmlParser); $pass[$i]["Column"] = xml_get_current_column_number($xmlParser); xml_parser_free($xmlParser); } if($pass[0]["Line"] != $pass[1]["Line"] || $pass[0]["Column"] != $pass[1]["Column"]) { echo "Pass1: Line " . $pass[0]["Line"] . ", Column " . $pass[0]["Column"] . "<br>"; echo "Pass2: Line " . $pass[1]["Line"] . ", Column " . $pass[1]["Column"]; $done = TRUE; } } ?> Typical results: Pass1: Line 3, Column 10 Pass2: Line 2, Column 52 Pass1: Line 1, Column 63 Pass2: Line 3, Column 10 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=2618&edit=1

« previous php.bugs (#10775) next »