From dd995dab0c48c03a25ecebde7864e13913fe49b3 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 19 Dec 2016 11:28:17 +0100 Subject: [PATCH] Fixed nesting of certain bbcodes --- .../files/lib/system/bbcode/HtmlBBCodeParser.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php index b3f407890b..7e8bc97774 100644 --- a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php @@ -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; } -- 2.20.1