Fixed element parent block detection
authorAlexander Ebert <ebert@woltlab.com>
Wed, 11 Oct 2017 14:25:47 +0000 (16:25 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 11 Oct 2017 14:25:47 +0000 (16:25 +0200)
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php

index 7162f5140abc50c931966e372f526b5292d1f741..bdf37f6d77dbe00d823f8faa3ab861a4d4973a42 100644 (file)
@@ -344,6 +344,10 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode {
                                $parentEnd = $end;
                                do {
                                        $parentEnd = $parentEnd->parentNode;
+                                       if ($parentEnd === null) {
+                                               break;
+                                       }
+                                       
                                        if ($parentEnd->nodeName === 'li') {
                                                if ($parent === $parentEnd) {
                                                        // same ancestor, exit both loops
@@ -354,7 +358,7 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode {
                                                break;
                                        }
                                }
-                               while ($parent);
+                               while ($parentEnd);
                                
                                $foundLi = true;
                        }