From:             thom at genx dot net
Operating system: Linux (gentoo)
PHP version:      5.1.2
PHP Bug Type:     DOM XML related
Bug description:  DOM XML breaks on copyright character in text node

Description:
------------
When a copyright character (ascii 169) is present in a string that is
added as a text node to the DOM structure, the element is always empty. 
The correct behavior is to encode the character as "©".

Reproduce code:
---------------
<?php
$doc = new DOMDocument('1.0');
$t = $doc->appendChild($doc->createElement('test'));
$t->appendChild($doc->createTextNode('&' . chr(169) . '<'));

header('Content-type: text/xml');
echo $doc->saveXML();
?>


Expected result:
----------------
<?xml version="1.0"?>
<test>&amp;&copy;&lt;</test>

Actual result:
--------------
<?xml version="1.0"?>
<test></test>

-- 
Edit bug report at http://bugs.php.net/?id=36263&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36263&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36263&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36263&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36263&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36263&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36263&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36263&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36263&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36263&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36263&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36263&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36263&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36263&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36263&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36263&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36263&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36263&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36263&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36263&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36263&r=mysqlcfg

Reply via email to