From 2ce76e4c0cd3f73483213854a641c12b2059d18a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 11 Oct 2017 16:25:47 +0200 Subject: [PATCH] Fixed element parent block detection --- .../input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php index 7162f5140a..bdf37f6d77 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php @@ -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; } -- 2.20.1