Fixed node splitting
authorAlexander Ebert <ebert@woltlab.com>
Tue, 12 Jul 2016 08:22:29 +0000 (10:22 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 12 Jul 2016 08:22:51 +0000 (10:22 +0200)
wcfsetup/install/files/lib/util/DOMUtil.class.php

index eebde6c26ceca2a6f3e554ac57394a8ebe66c7a0..36a94ae0fa3ffb49b4f95952d96c527153add98c 100644 (file)
@@ -445,11 +445,12 @@ final class DOMUtil {
                        
                        $currentNode = $node;
                        while (($parent = $currentNode->parentNode) !== $ancestor) {
+                               /** @var \DOMElement $newNode */
                                $newNode = $parent->cloneNode();
                                self::insertBefore($newNode, $parent);
                                
                                while ($currentNode->previousSibling) {
-                                       $newNode->appendChild($currentNode->previousSibling);
+                                       self::prepend($currentNode->previousSibling, $newNode);
                                }
                                
                                $currentNode = $parent;