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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: info at mybrain dot nl
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC