#21477 [Ana->Csd]: $node->dump_node($node) crashes with libxml2-2.4.30

From: Date: Sat, 11 Jan 2003 09:41:21 +0000
Subject: #21477 [Ana->Csd]: $node->dump_node($node) crashes with libxml2-2.4.30
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29758@lists.php.net to get a copy of this message
ID: 21477 Updated by: chregu@php.net Reported By: gk@proliberty.com -Status: Analyzed +Status: Closed Bug Type: DOM XML related Operating System: linux; kernel 2.4.18 PHP Version: 4.3.0 Assigned To: New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. And fixed in CVS PHP_4_3 as well. Previous Comments: ------------------------------------------------------------------------ [2003-01-10 13:48:00] iliaa@php.net This is a valid bug, by initial conclusion as to the nature of this bug was wrong. ------------------------------------------------------------------------ [2003-01-10 12:54:57] sniper@php.net You're not in position to decide what is bogus and what is not. This is bogus. ------------------------------------------------------------------------ [2003-01-10 12:50:17] gk@proliberty.com Thanks for identifying the problem, chregu. But your comment didn't specify WHICH $root in the sample code was causing the problem. Here's an example: <?php $xml=<<<eot <node attr="test"><test>hi</test> </node> eot; $doc = domxml_open_mem($xml); $root=$doc->document_element(); //This won't work: //$nodeDump =$doc->dump_node($doc); //This crashes: //$nodeDump =$root->dump_node($root); //This works: $nodeDump =$doc->dump_node($root); echo htmlentities($nodeDump); ?> I have re-opened the bug for integrity of the bug database: a bug is not 'Bogus' if PHP crashes due to scripting errors. For the sake of others who get bitten, this should stay open until fixed, then set it to 'Closed'. ------------------------------------------------------------------------ [2003-01-10 11:56:45] chregu@php.net The error is here: $nodeContent =$root->dump_node($root); $root has to be a DOM_DOCUMENT and in your case it's DOM_ELEMENT. I'll fix the code, so it will throw an error, if it's not a DOM_DOCUMENT chregu ------------------------------------------------------------------------ [2003-01-10 04:44:37] gk@proliberty.com modified bug title to be more specific ------------------------------------------------------------------------ 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/21477 -- Edit this bug report at http://bugs.php.net/?id=21477&edit=1

« previous php.bugs (#29758) next »