Fixed handling of incorrectly nested bbcodes
authorAlexander Ebert <ebert@woltlab.com>
Sun, 25 Sep 2016 08:00:35 +0000 (10:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 25 Sep 2016 08:00:35 +0000 (10:00 +0200)
wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php

index acddebcc22be96f0ec1ef411d10b4ba6949a141a..af6db4cef0e3c1f4cda895d88b227306181560d6 100644 (file)
@@ -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);