Bug #55531 [NEW]: Vertical tabs ignored by XMLWriter
| From: | brianlmoon@php.net | Date: | Mon, 29 Aug 2011 15:52:19 +0000 |
| Subject: | Bug #55531 [NEW]: Vertical tabs ignored by XMLWriter | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-163106@lists.php.net to get a copy of this message | ||
From: brianlmoon
Operating system: Linux
PHP version: 5.3.8
Package: XML related
Bug Type: Bug
Bug description:Vertical tabs ignored by XMLWriter
Description:
------------
When text contains vertical tabs, XMLWriter silently ignores them and
generates invalid XML. This is not an issue where the text is invalid
UTF-8. It is valid UTF-8 data. Vertical tabs are simply not allowed in XML
by rule. I would expect XMLWriter to encode it as it would any other
character not allowed in XML. I suspect that
Test script:
---------------
<?php
$xml = new XmlWriter();
$xml->openMemory();
$xml->startDocument('1.0', 'UTF-8');
$xml->writeElement("test", "This data contains a \vvertical tab");
$xml->endElement();
$data = $xml->outputMemory(true);
$sxml = simplexml_load_string($data);
?>
Expected result:
----------------
Either an error or valid XML.
Actual result:
--------------
Invalid XML is silently created. For example, SimpleXML::addchild() throws
a warning: SimpleXMLElement::asXML(): xmlEscapeEntities : char out of range
when a vertical tab is present and the node is not added.
--
Edit bug report at https://bugs.php.net/bug.php?id=55531&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55531&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55531&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55531&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55531&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55531&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55531&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55531&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55531&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55531&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55531&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55531&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55531&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55531&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55531&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55531&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55531&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55531&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55531&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55531&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55531&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55531&r=mysqlcfg