Bug #74036 [Com]: createTextNode() does not handle binary data
| From: | judge2005 at gmail dot com | Date: | Thu, 02 Feb 2017 17:10:37 +0000 |
| Subject: | Bug #74036 [Com]: createTextNode() does not handle binary data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207129@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74036&edit=1
ID: 74036
Comment by: judge2005 at gmail dot com
Reported by: judge2005 at gmail dot com
Summary: createTextNode() does not handle binary data
Status: Open
Type: Bug
Package: DOM XML related
Operating System: RHEL 7
PHP Version: 7.0.15
Block user comment: N
Private report: N
New Comment:
Looks like your bug report system strips out the binary. The additional characters were ETX, EOT and
DC4
Previous Comments:
------------------------------------------------------------------------
[2017-02-02 17:08:20] judge2005 at gmail dot com
Description:
------------
If binary data is passed to createTextNode() it can cause invalid XML to be generated.
Test script:
---------------
<?php
$document = new DOMDocument('1.0', 'UTF-8');
$document->formatOutput = true;
$root = $document->createElement('example');
$document->appendChild($root);
$example = $document->createTextNode("PK");
$root->appendChild($example);
echo $document->saveXML();
Actual result:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<example>PK</example>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74036&edit=1