diff --git a/file/lib/data/message/MessageAction.class.php b/file/lib/data/message/MessageAction.class.php index 9f0816b..5c33e09 100644 --- a/file/lib/data/message/MessageAction.class.php +++ b/file/lib/data/message/MessageAction.class.php @@ -52,6 +52,12 @@ public function validateSend() { // validate text if (strlen($this->parameters['text']) > CHAT_MAX_LENGTH) throw new UserInputException('text', 'tooLong'); + // search for disallowed bbcodes + $disallowedBBCodes = \wcf\system\bbcode\BBCodeParser::getInstance()->validateBBCodes($this->parameters['text'], explode(',', WCF::getSession()->getPermission('user.chat.allowedBBCodes'))); + if (!empty($disallowedBBCodes)) { + throw new UserInputException('text', WCF::getLanguage()->getDynamicVariable('wcf.message.error.disallowedBBCodes', array('disallowedBBCodes' => $disallowedBBCodes))); + } + // search for censored words if (ENABLE_CENSORSHIP) { $result = \wcf\system\message\censorship\Censorship::getInstance()->test($this->parameters['text']); diff --git a/option.xml b/option.xml index 2a88897..aa1181f 100644 --- a/option.xml +++ b/option.xml @@ -37,12 +37,6 @@ 1 5 - +