#34916 [NEW]: php 5.05/libXML 2.6.9 string variable fault

From: Date: Wed, 19 Oct 2005 13:17:45 +0000
Subject: #34916 [NEW]: php 5.05/libXML 2.6.9 string variable fault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-86737@lists.php.net to get a copy of this message
From: ndb1974 at yahoo dot co dot uk Operating system: UNIX PHP version: 5.0.5 PHP Bug Type: SimpleXML related Bug description: php 5.05/libXML 2.6.9 string variable fault Description: ------------ php 5.0.4 contains libXML 2.6.11 This works appears to work correctly with text string variables php 5.05 contains libXML 2.6.9 (not sure why it contains an older libXML) This version combination contains a fault where XML string content containing apostrophes (') is corrupted when reading or writing XML variables using simpleXML. The XML functionality tries to escape the apostrophe with several backspaces, corrupting the string when it is processed. But this does NOT happen with libXML 2.6.11. Reproduce code: --------------- Store an XML doc like: <testdoc> <testvar>Something's not right with ' chars</testvar> </testdoc> Open it with a php script like: $dom = new DomDocument; $xml = simplexml_load_file($XMLTestDoc); $XMLpath = $xml -> xpath("/testdoc"); $teststring = $XMLpath[0] -> testvar; echo ($teststring); Expected result: ---------------- Should see same string again. Actual result: -------------- String is displayed like: Something\\\\'s not right with \\\' chars (i.e. corrupted with backslashes). -- Edit bug report at http://bugs.php.net/?id=34916&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34916&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34916&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34916&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34916&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34916&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34916&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34916&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34916&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34916&r=support Expected behavior: http://bugs.php.net/fix.php?id=34916&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34916&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34916&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34916&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34916&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34916&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34916&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34916&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34916&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34916&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34916&r=mysqlcfg

« previous php.bugs (#86737) next »