Re: XML_Tree bug fix

From: Date: Wed, 12 Mar 2003 03:00:24 +0000
Subject: Re: XML_Tree bug fix
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-14212@lists.php.net to get a copy of this message
I haven't heard anything back from this so I have attached the diffs this time. Is it maybe that no-one uses the XML_Tree class? Is there a better class to use ? Blair Robertson wrote: > Gday, > > I have noticed (and fixed) a couple issues in the XML_Tree : > > XML/Tree.php > - see Bug #19667 on bugs.php.net (http://bugs.php.net/bug.php?id=19667) > if the char data of a node was '0' (zero) the data wouldn't be > set. The solution was a simple change in the cdataHandler() fn > - getTreeFromString() didn't return the root node by reference, > which getTreeFromFile() does. > > XML/Tree/Node.php > - Attribute values weren't having their single or double quotes escaped > - The content of the nodes wheren't having the <, >, ', " (left and > right angle brackets, single and double quotes) escaped. > > Another thing that I changed was the moving of the _xml_entities() call > from the setContent() to being called in get(), this is because by > escaping the contents in setContent() - which get's called when parsing > any xml as well as when a user is creating a tree in the code - it > leave's the user with the task of unescaping the content before they > can use it outside the tree. If this doesn't make sense I can provide > an example. > > > Anyway the diff's for the fixes are available at > http://beta.squiz.net/~brobertson/public/xml_tree/ > with the full version of the files being under the new/ dir > > tell me what you think, > > Blair > > > >

« previous php.pear.dev (#14212) next »