From b8100eaa3bfbad12dd8c758c1d28dd953b4e48fc Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Mon, 21 Apr 2008 22:11:55 +0200 Subject: [PATCH] More cloning fixes. clone.xml doesn't pass, but it passes morally. --- php5/xml-template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php5/xml-template.php b/php5/xml-template.php index 7ae6dcb..08c78ab 100644 --- a/php5/xml-template.php +++ b/php5/xml-template.php @@ -99,16 +99,16 @@ function XML_Template_process($node, $obj, $clean = 1) } # remove all the tags - for ($i = 0; $i < $node->childNodes->length; ++$i) { $child = $node->childNodes->item($i); if ($child->localName != 'temporary-fragment') { continue; } - for ($j = 0; $j < $child->childNodes->length; ++$j) { - $child2 = $child->childNodes->item($j); + while ($child->childNodes->length > 0) { + $child2 = $child->childNodes->item(0); $node->appendChild($child2); } + --$i; $node->removeChild($child); } } -- 2.39.2