Fix issues with heavily nested block bbcodes
authorAlexander Ebert <ebert@woltlab.com>
Sun, 23 Apr 2017 12:37:26 +0000 (14:37 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 23 Apr 2017 12:37:31 +0000 (14:37 +0200)
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php

index 9f2303c0f1199cff123740e4efd48e0f16bde3dd..7955b4fffbca85847197ddb4b152dd21099cf4f9 100644 (file)
@@ -340,7 +340,7 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode {
                while ($parent->nodeName === 'p' || !$this->isBlockElement($parent));
                
                $element = DOMUtil::splitParentsUntil($start, $parent);
-               DOMUtil::insertBefore($start, $element);
+               if ($start !== $element) DOMUtil::insertBefore($start, $element);
                
                $commonAncestor = DOMUtil::getCommonAncestor($start, $end);
                $lastElement = DOMUtil::splitParentsUntil($end, $commonAncestor, false);