Fix for nested source bbcodes
authorAlexander Ebert <ebert@woltlab.com>
Tue, 23 Aug 2016 19:59:57 +0000 (21:59 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 24 Aug 2016 09:10:34 +0000 (11:10 +0200)
wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php

index 2b358a0de80c54fb88b10df3036003c2f1c252ad..d7b314c37eb63e235cb7875b28f89744bc75fdd8 100644 (file)
@@ -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']."'.");
                }