|  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
 [2018-02-05 10:36 UTC] info at mybrain dot nl
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"/>
	echo '1';
	try {
		echo '2';
		$a = xml_parse($xml_parser, $data);
		echo '3';
	} catch (Exception $e) {
		echo 'Caught exception: ',  $e->getMessage(), "\n";
	echo '4';

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


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]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2018-02-05 12:12 UTC]
> Apologies, not a bug;

Fine, closing.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 03:01:27 2024 UTC