From:             franck at cassedanne dot com
Operating system: BSD, Linux, OSX
PHP version:      5.3.19
Package:          XML Writer
Bug Type:         Bug
Bug description:XMLWriter handling of double-quotes not consistent with other 
libxml extensions

Description:
------------
XMLWriter differs in its handling of double-quotes when compared to other
libxml
based PHP extensions.

Double-quotes using XMLWriter are converted to htmlentities (i.e.
'"').
Using SimpleXML or DOMDocument double-quotes stay unconverted.

It seems to me that XMLWriter should not be converting double-quotes
either.

Tidy seems to also agree -- try the following in a CLI:
$ echo "<?xml encoding=\"UTF-8\"?><tag>&quot;</tag>" | tidy -xml -q

Maybe introducing a flag/constant such as ENT_NOQUOTES to toggle the
conversion of 
these on and off might be pertinent.

Test script:
---------------
<?php
$x = new XMLWriter;
$x->openMemory();
$x->startDocument('1.0', 'UTF-8');
$x->writeElement('tag', '"');
$x->endDocument();
echo $x->flush();


Expected result:
----------------
<?xml version=\"1.0\" encoding=\"UTF-8\"?><tag>"</tag>

Actual result:
--------------
<?xml version=\"1.0\" encoding=\"UTF-8\"?><tag>&quot;</tag>

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63589&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63589&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63589&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63589&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63589&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63589&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63589&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63589&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63589&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63589&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63589&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63589&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63589&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63589&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63589&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63589&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63589&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63589&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63589&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63589&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63589&r=mysqlcfg

Reply via email to