From 9eb1e9648af5d3cc9159d4a8b9bbf7240ea2b9a0 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 23 Aug 2016 21:59:57 +0200 Subject: [PATCH] Fix for nested source bbcodes --- .../files/lib/system/bbcode/HtmlBBCodeParser.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php index 2b358a0de8..d7b314c37e 100644 --- a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php @@ -460,6 +460,12 @@ class HtmlBBCodeParser extends BBCodeParser { $data = array_pop($this->openTagIdentifiers); if ($data['name'] !== $name) { + // check if this is a source code tag as some people + // love to nest the same source bbcode + if (in_array($name, $this->getSourceBBCodes())) { + return $tag['source']; + } + throw new SystemException("Tag mismatch, expected '".$name."', got '".$data['name']."'."); } -- 2.20.1