Fixed nesting of certain bbcodes
authorAlexander Ebert <ebert@woltlab.com>
Mon, 19 Dec 2016 10:28:17 +0000 (11:28 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 19 Dec 2016 10:28:24 +0000 (11:28 +0100)
wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php

index b3f407890b9ed09383dc6c52cde2f6cfb4aa10eb..7e8bc97774f212742224505eab2fd3de4421f15c 100644 (file)
@@ -20,6 +20,12 @@ use wcf\util\StringUtil;
  * @since      3.0
  */
 class HtmlBBCodeParser extends BBCodeParser {
+       /**
+        * list of bbcodes that cannot be nested
+        * @var string[]
+        */
+       public static $disallowNesting = ['attach', 'b', 'code', 'email', 'i', 'img', 'media', 's', 'tt', 'u', 'url', 'user', 'wsm', 'wsp'];
+       
        /**
         * list of open tags with name and uuid
         * @var array
@@ -125,7 +131,7 @@ class HtmlBBCodeParser extends BBCodeParser {
                                        $sibling = $this->tagArray[$j];
                                        if ($sibling['name'] === $name) {
                                                if (!$sibling['closing']) {
-                                                       if ($name === 'quote') {
+                                                       if (!in_array($name, self::$disallowNesting)) {
                                                                continue;
                                                        }