From: Alexander Ebert Date: Sat, 14 May 2016 21:24:21 +0000 (+0200) Subject: Added prototype BBCode -> HTML parser X-Git-Tag: 3.0.0_Beta_1~1732 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=60a355056d4efdda383c483bce4aadca06f962cb;p=GitHub%2FWoltLab%2FWCF.git Added prototype BBCode -> HTML parser --- diff --git a/wcfsetup/install/files/lib/form/MessageForm.class.php b/wcfsetup/install/files/lib/form/MessageForm.class.php index 677de11f4a..04b68237b6 100644 --- a/wcfsetup/install/files/lib/form/MessageForm.class.php +++ b/wcfsetup/install/files/lib/form/MessageForm.class.php @@ -267,13 +267,13 @@ abstract class MessageForm extends AbstractCaptchaForm { throw new UserInputException('text', 'tooLong'); } - if ($this->enableBBCodes && $this->allowedBBCodesPermission) { + /*if ($this->enableBBCodes && $this->allowedBBCodesPermission) { $disallowedBBCodes = BBCodeParser::getInstance()->validateBBCodes($this->text, ArrayUtil::trim(explode(',', WCF::getSession()->getPermission($this->allowedBBCodesPermission)))); if (!empty($disallowedBBCodes)) { WCF::getTPL()->assign('disallowedBBCodes', $disallowedBBCodes); throw new UserInputException('text', 'disallowedBBCodes'); } - } + }*/ // search for censored words if (ENABLE_CENSORSHIP) { diff --git a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php new file mode 100644 index 0000000000..f164b31394 --- /dev/null +++ b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php @@ -0,0 +1,205 @@ + + * that can be safely passed through HTMLPurifier's validation mechanism. + * + * All though not exactly required for all bbcodes, the actual output of an bbcode + * cannot be forseen and potentially conflict with HTMLPurifier's whitelist. Examples + * are