Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.2

Bug #220 & Break after process
Submitted: 2003-11-10 10:01 UTC
From: saran at inra dot co dot th Assigned: schst
Status: Closed Package: XML_Beautifier
PHP Version: 4.3.3 OS: Windows XP
Roadmaps: (Not assigned)    

 [2003-11-10 10:01 UTC] saran at inra dot co dot th
Description: ------------ When pass xml string that has '&AMP;' characters to formatString function, it will break to '& AMP;' (Note the space) and thus make this xml invalid. Reproduce code: --------------- $store="mark & spencer"; $store=htmlentities($store); // now store=='mark & spencer' require_once('xml/beautifier.php'); $bf=new XML_Beautifier(); $xml="<?xml version=\"1.0\"?><root><store>$store</store></root>"; $xml=$bf->formatString($xml); echo $xml; Expected result: ---------------- <?xml version="1.0"?> <root> <store>mark & spencer</store> </root> Actual result: -------------- <?xml version="1.0"?> <root> <store>mark & amp; spencer</store> </root>


 [2003-11-10 10:12 UTC] schst
I could'n reproduce the error, but an XML_Util::replaceXMLSpecialchars() is missing, will be fixed in the next release
 [2003-11-10 20:49 UTC] schst
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on In case this was a website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. Please try the new CVS version. In all of my tests it worked properly.
 [2003-11-11 02:14 UTC] saran at inra dot co dot th
Please accept my apologies, there is my fault in the first post. I did htmlentities() twice that's why it look like '& AMP;' breaks. But coincidently there is missing special characters treatment routine at that point and it is now fixed in CVS. Thanks for your prompt response and I will be more careful in the next post.
 [2003-11-11 19:37 UTC] schst
Thank you for your bug report. This issue has already been fixed in the latest released version of the package, which you can download at Fixed in release 0.2.1