From: Alexander Ebert Date: Mon, 18 Jul 2016 13:25:15 +0000 (+0200) Subject: Properly handle reverted bbcodes X-Git-Tag: 3.0.0_Beta_1~1053 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=14b6dc2a8c89b86a63c6815d768155b78b2d16fb;p=GitHub%2FWoltLab%2FWCF.git Properly handle reverted bbcodes --- 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 9e4d154abd..fd01b19530 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 @@ -91,19 +91,26 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode { }; foreach ($groups as $name => $pairs) { + $needsReindex = false; for ($i = 0, $length = count($pairs); $i < $length; $i++) { $pair = $pairs[$i]; if ($isInsideCode($pair['open']) || $isInsideCode($pair['close'])) { $pair['attributes'] = $htmlNodeProcessor->parseAttributes($pair['attributes']); $this->convertToBBCode($name, $pair); + $needsReindex = true; unset($groups[$name][$i]); if (empty($groups[$name])) { + $needsReindex = false; unset($groups[$name]); } } } + + if ($needsReindex) { + $groups[$name] = array_values($groups[$name]); + } } return $groups;