ID: 44478 User updated by: vesko at webstudiobulgaria dot com Reported By: vesko at webstudiobulgaria dot com Status: Open Bug Type: SimpleXML related Operating System: Debian testing PHP Version: 5.2.5 New Comment:
It is fixed now. I hope the patch will be included in the upcoming 5.2.6 :) Previous Comments: ------------------------------------------------------------------------ [2008-03-20 11:54:32] [EMAIL PROTECTED] Oh, really. I've updated the patch. :) ------------------------------------------------------------------------ [2008-03-20 09:15:40] vesko at webstudiobulgaria dot com Hi Felipe, Thanks for the patch. I've tested it against 5.2.5 source. It fixes the case: $xml_element->addChild('node2','c & d'); but not the case: $xml_element->node1[0] = 'a & b';//still decodes ------------------------------------------------------------------------ [2008-03-20 00:22:06] [EMAIL PROTECTED] Simple patch: http://felipe.ath.cx/diff/bug44478.diff ------------------------------------------------------------------------ [2008-03-19 13:16:15] vesko at webstudiobulgaria dot com And another one: $xml_element->node1[0] = 'a & b'; decodes the html entities while it should not. ------------------------------------------------------------------------ [2008-03-19 12:53:10] vesko at webstudiobulgaria dot com Based on: $xml_element = new simpleXMLElement('<root></root>'); $xml_element['attrib1'] = 'a & b'; $xml_element->addAttribute('attrib2','c & d'); print $xml_element['attrib1']; print $xml_element['attrib2']; which gives: a & bc & d I guess the correct behaviour is to leave the entities as they are, so in the previous example addChild() gives the wring result. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/44478 -- Edit this bug report at http://bugs.php.net/?id=44478&edit=1