From: fletch at pobox dot com Operating system: linux PHP version: 5.2.0 PHP Bug Type: DOM XML related Bug description: DOMDocument->createElement() unescapes numeric character references in values
Description: ------------ DOMDocument->createElement() unescapes any numeric character references (NCRs) contained in the value passed to its optional second parameter. It should preserve the value as passed. Reproduce code: --------------- <?php $dom = new DOMDocument( "1.0", 'UTF-8' ); $dom->appendChild( $dom->createElement( 'root', '& ' ) ); var_dump( trim( $dom->saveXML() ) ); ?> Expected result: ---------------- string(59) "<?xml version="1.0" encoding="UTF-8"?> <root>& </root>" Actual result: -------------- string(59) "<?xml version="1.0" encoding="UTF-8"?> <root>& </root>" -- Edit bug report at http://bugs.php.net/?id=40105&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40105&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40105&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40105&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40105&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40105&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40105&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40105&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40105&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40105&r=support Expected behavior: http://bugs.php.net/fix.php?id=40105&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40105&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40105&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40105&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40105&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40105&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40105&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40105&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40105&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40105&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40105&r=mysqlcfg
