Bug #72550 [NEW]: xml_get_current_line_number gives wrong numbers. col too?

From: Date: Wed, 06 Jul 2016 00:22:27 +0000
Subject: Bug #72550 [NEW]: xml_get_current_line_number gives wrong numbers. col too?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202082@lists.php.net to get a copy of this message
From:             jim dot michaels at Jesusnjim dot com
Operating system: vista 32 amd64
PHP version:      7.1.0alpha1
Package:          XML related
Bug Type:         Bug
Bug description:xml_get_current_line_number gives wrong numbers. col too?

Description:
------------
./menu7a.xml: 4576:1, ERROR:No error (error may be on previous line)
don't have a small test script. this error is past end of file, which is
line 4568.

Test script:
---------------
$contents = @file_get_contents($xmlFile);//for tag content replacement

$xmlArray=array();
$tags=array();
global $AcctTypes,$TagTypes,$rootTag;
//this is the list of

$parser = xml_parser_create_ns('utf-8',':'); // WORKS JUST FINE
$xmlSuccess=xml_parse_into_struct($parser, $contents, $xmlArray,
$tags);
if (XML_ERROR_NONE!=xml_get_error_code($parser) || $xmlSuccess) {
	echo "-------------------------XML
ERROR-------------------------\r\n".
	     "-------------------------XML
ERROR-------------------------\r\n".
	     "-------------------------XML
ERROR-------------------------\r\n".
		$xmlFile.': '.xml_get_current_line_number($parser).':'.
		xml_get_current_column_number($parser).', ERROR:'.
		xml_error_string(xml_get_error_code($parser)).
		" (error may be on previous line)\r\n".
	     "-------------------------XML
ERROR-------------------------\r\n".
	     "-------------------------XML
ERROR-------------------------\r\n".
	     "-------------------------XML
ERROR-------------------------\r\n";
	xml_parser_free($parser);
	exit(1);
}
xml_parser_free($parser);


Expected result:
----------------
line number matching the problem. 
someone put random number generator in the parser/lexer?

Actual result:
--------------
./menu7a.xml: 4576:1, ERROR:No error (error may be on previous line)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=72550&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=72550&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=72550&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=72550&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=72550&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=72550&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=72550&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=72550&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=72550&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=72550&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=72550&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=72550&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=72550&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=72550&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72550&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=72550&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=72550&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=72550&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72550&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=72550&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=72550&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#202082) next »