Bug #16153 [Com]: XML Entities are removed entirely

From: Date: Tue, 27 Mar 2012 23:28:35 +0000
Subject: Bug #16153 [Com]: XML Entities are removed entirely
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-8458@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=16153&edit=1 ID: 16153 Comment by: jay.knight@stjude.org Reported By: ionut dot aivanesei at gmail dot com Summary: XML Entities are removed entirely Status: Open Type: Bug Package: XML_Serializer Operating System: SunOS Package Version: 0.19.2 PHP Version: Irrelevant Roadmap Versions: New Comment: We've just started experiencing this is in version 0.20.2. We recently did a system upgrade, I'm not sure what version we had before. The workaround in #16154 doesn't seem to be helping. Any ideas? Previous Comments: ------------------------------------------------------------------------ [2009-05-23 19:12:54] doconnor See solution/workaround in Bug #16154 ------------------------------------------------------------------------ [2009-04-27 11:13:23] jordic Me too! Fedore Core, 8 1) testBugXMLAmpersands(testDocumentXmlDs) Failed asserting that two objects are equal. --- Expected +++ Actual @@ -10,7 +10,7 @@ *RECURSION* [_d:protected] => Array ( - [title] => b&a + [title] => ba [_id] => 49f57845ef39d ) @@ -34,7 +34,7 @@ *RECURSION* [_d:protected] => Array ( - [title] => b&a + [title] => ba [_id] => 49f57845ef39d ) ------------------------------------------------------------------------ [2009-04-27 03:33:37] galiganu Please note that I used in the xml the entity &amp;amp;, but the bug description it doesn't decode it correctly. ------------------------------------------------------------------------ [2009-04-27 03:29:58] galiganu Description: ------------ I have the a xml file (test.xml) containing following: <?xml version="1.0" encoding="utf-8" ?> <applications> <application> <id>1</id> <application_name>A&B</application_name> </application> </applications> When trying to unserialize it the '&' is removed from the string (entirely). Please note that everything goes OK on my Windows PC (with same package and php version). Only on the solaris server I have this issue. Test script: --------------- <?php $options = array( 'complexType' => 'array', 'parseAttributes' => false, 'whitespace' => XML_UNSERIALIZER_WHITESPACE_TRIM, 'guessTypes' => false); $unserializer = &new XML_UNserializer($options); $result = $unserializer->unserialize('test.xml', true); if ($result === true) { $data = $unserializer->getUnserializedData(); } ?> Expected result: ---------------- Array ( [application] => Array ( [id] => 1 [application_name] => A&B ) ) Actual result: -------------- Array ( [application] => Array ( [id] => 1 [application_name] => AB ) ) ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=16153&edit=1

« previous php.pear.bugs (#8458) next »