From: Alexander Ebert Date: Sun, 25 Sep 2016 08:00:35 +0000 (+0200) Subject: Fixed handling of incorrectly nested bbcodes X-Git-Tag: 3.0.0_Beta_2~157 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4bc4c689893bd8662999912a6adb2da2284eaf9;p=GitHub%2FWoltLab%2FWCF.git Fixed handling of incorrectly nested bbcodes --- diff --git a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php index acddebcc22..af6db4cef0 100644 --- a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php @@ -71,11 +71,7 @@ class HtmlBBCodeParser extends BBCodeParser { while (($previousTag = end($openTagStack)) != $tag['name']) { $nextIndex = count($newTagArray); - // mark as invalid and do not flag as opened tag - $newTag = $this->buildTag('[/'.end($openTagStack).']'); - $newTag['invalid'] = true; - - $newTagArray[$nextIndex] = $newTag; + $newTagArray[$nextIndex] = $this->buildTag('[/'.end($openTagStack).']'); if (!isset($newTextArray[$nextIndex])) $newTextArray[$nextIndex] = ''; $newTextArray[$nextIndex] .= $this->textArray[$i]; $this->textArray[$i] = ''; @@ -127,11 +123,7 @@ class HtmlBBCodeParser extends BBCodeParser { while (end($openTagStack)) { $nextIndex = count($newTagArray); - // mark as invalid - $newTag = $this->buildTag('[/'.end($openTagStack).']'); - $newTag['invalid'] = true; - - $newTagArray[$nextIndex] = $newTag; + $newTagArray[$nextIndex] = $this->buildTag('[/'.end($openTagStack).']'); if (!isset($newTextArray[$nextIndex])) $newTextArray[$nextIndex] = ''; array_pop($openTagStack); array_pop($openTagDataStack);