php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75919 xml_parse dies when <table> node is used
Submitted: 2018-02-05 10:36 UTC Modified: 2018-02-05 12:12 UTC
From: info at mybrain dot nl Assigned: cmb (profile)
Status: Not a bug Package: *XML functions
PHP Version: 7.2.2 OS: Windows2008R2 IIS7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
41 + 42 = ?
Subscribe to this entry?

 
 [2018-02-05 10:36 UTC] info at mybrain dot nl
Description:
------------
I am upgrading functioning code from PHP 5.x to 7.2.2 and the function completely dies the script hits xml_parse, and the data chunk contains a node with the 'table' name.

The following code gives '12' as output, nothing else.
When '<table />' is changed to '<ttable />' there is no issue, then I get '1234' as output.


Test script:
---------------
	$data = '<?xml version="1.0" encoding="ISO-8859-1" ?>
	<table />
	<img texttype="text/html"/>
	</DOC>';
	echo '1';
	try {
		echo '2';
		$a = xml_parse($xml_parser, $data);
		echo '3';
	} catch (Exception $e) {
		echo 'Caught exception: ',  $e->getMessage(), "\n";
	}
	echo '4';
	exit;

Expected result:
----------------
1234

Actual result:
--------------
12

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-05 11:14 UTC] info at mybrain dot nl
Apologies, not a bug;
I think it's in one of the attached handlers...
missed that bit of code when I was debugging this, oops :-)

 xml_set_element_handler($xml_parser, "startElement", "endElement");
 xml_set_character_data_handler($xml_parser, "characterData");
 [2018-02-05 12:12 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2018-02-05 12:12 UTC] cmb@php.net
> Apologies, not a bug;

Fine, closing.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 04:05:54 2022 UTC