#30746 [NEW]: simplexml_load_file fails if the data contains the '&' or '<' or '>' character

From: Date: Wed, 10 Nov 2004 13:13:28 +0000
Subject: #30746 [NEW]: simplexml_load_file fails if the data contains the '&' or '<' or '>' character
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68891@lists.php.net to get a copy of this message
From: manoj_smartsoft at rediffmail dot com Operating system: Windows-XP PHP version: 5.0.2 PHP Bug Type: *XML functions Bug description: simplexml_load_file fails if the data contains the '&' or '<' or '>' character Description: ------------ If the XML file conatinx &,< or > in the data field, then the simplexml_load_file fails Reproduce code: --------------- // * bug_file.xml : START * // <?xml version='1.0' standalone='yes'?> <couples> <couple> <name>John&Marry</name> <age>John>Marry</age> </couple> </couples> // * bug_file.xml : END * // <?php $xml = simplexml_load_file("bug_file.xml"); echo $xml->couple[0]->name; // "So this language. It's ike..." ?> Expected result: ---------------- This should give me the following result John&Marry Actual result: -------------- The actual result is that, the function returns error. -- Edit bug report at http://bugs.php.net/?id=30746&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30746&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30746&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30746&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30746&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30746&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30746&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30746&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30746&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30746&r=support Expected behavior: http://bugs.php.net/fix.php?id=30746&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30746&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30746&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30746&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30746&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30746&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30746&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30746&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30746&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30746&r=mysqlcfg

« previous php.bugs (#68891) next »