#32340 [Fbk->Csd]: insert_before($node,NULL) does not return
| From: | rrichards@php.net | Date: | Thu, 17 Mar 2005 13:14:11 +0000 |
| Subject: | #32340 [Fbk->Csd]: insert_before($node,NULL) does not return | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75433@lists.php.net to get a copy of this message | ||
ID: 32340
Updated by: rrichards@php.net
Reported By: felix at fbreuer dot de
-Status: Feedback
+Status: Closed
Bug Type: DOM XML related
Operating System: Windows
PHP Version: 4.3.10
New Comment:
This bug has been fixed in CVS.
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/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-03-17 09:43:22] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2005-03-16 16:41:06] felix at fbreuer dot de
Description:
------------
When using insert_before($node,NULL) to insert a DOM element as the
last child of some other element, insert_before never returns (and does
not throw an error).
This call will work, if $node is unlinked before. The documentation of
insert_node, however, says that unlinking is not required.
See example code below.
Reproduce code:
---------------
<?php
$doc = domxml_open_mem("<foo><bar/></foo>");
$dom = domxml_open_mem("<outer><inner/></outer>");
$root = $doc->document_element();
$node = $dom->document_element();
//$node->unlink_node(); // uncomment this to work
$root->insert_before($node,NULL);
echo $doc->dump_mem();
?>
Expected result:
----------------
Ideally:
<foo><bar/><outer><inner/></outer></foo>
If it is desired that the user has to explicitly unlink the node before
inserting it, it would be nice to have an error message. insert_before
should not hang.
Actual result:
--------------
insert_before does not return. The page is never sent to the client. No
error message is given.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32340&edit=1