Bug #75919 [Opn->Nab]: xml_parse dies when <table> node is used
| From: | cmb@php.net | Date: | Mon, 05 Feb 2018 12:12:56 +0000 |
| Subject: | Bug #75919 [Opn->Nab]: xml_parse dies when <table> node is used | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213816@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75919&edit=1
ID: 75919
Updated by: cmb@php.net
Reported by: info at mybrain dot nl
Summary: xml_parse dies when <table> node is used
-Status: Open
+Status: Not a bug
Type: Bug
Package: *XML functions
Operating System: Windows2008R2 IIS7
PHP Version: 7.2.2
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> Apologies, not a bug;
Fine, closing.
Previous Comments:
------------------------------------------------------------------------
[2018-02-05 11:14:34] 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 10:36:35] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75919&edit=1