Fix for incorrectly nested bbcodes
authorAlexander Ebert <ebert@woltlab.com>
Sun, 18 Jun 2017 12:53:26 +0000 (14:53 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 18 Jun 2017 12:53:26 +0000 (14:53 +0200)
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php

index 7955b4fffbca85847197ddb4b152dd21099cf4f9..a7fa114349e4867b8d34a2dff266ce62d0dbaec0 100644 (file)
@@ -380,6 +380,8 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode {
                        DOMUtil::removeNode($start);
                        
                        $element = DOMUtil::getParentBefore($element, $commonAncestor);
+                       if ($element === null) $element = $commonAncestor;
+                       
                        while ($element = $element->nextSibling) {
                                if ($element->nodeType === XML_TEXT_NODE) {
                                        // ignore text nodes between tags