use wcf\data\IExtendedMessageQuickReplyAction;
use wcf\data\IMessageInlineEditorAction;
use wcf\data\IMessageQuoteAction;
+use wcf\system\bbcode\BBCodeParser;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
use wcf\system\message\censorship\Censorship;
throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.tooLong', array('maxTextLength' => WCF::getSession()->getPermission('user.conversation.maxLength'))));
}
+ // search for disallowed bbcodes
+ $disallowedBBCodes = BBCodeParser::getInstance()->validateBBCodes($message, explode(',', WCF::getSession()->getPermission('user.message.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 = Censorship::getInstance()->test($message);
{lang}wcf.message.error.tooLong{/lang}
{elseif $errorType == 'censoredWordsFound'}
{lang}wcf.message.error.censoredWordsFound{/lang}
+ {elseif $errorType == 'disallowedBBCodes'}
+ {lang}wcf.message.error.disallowedBBCodes{/lang}
{else}
{lang}wcf.conversation.message.error.{@$errorType}{/lang}
{/if}
{lang}wcf.global.form.error.empty{/lang}
{elseif $errorType == 'tooLong'}
{lang}wcf.message.error.tooLong{/lang}
+ {elseif $errorType == 'censoredWordsFound'}
+ {lang}wcf.message.error.censoredWordsFound{/lang}
+ {elseif $errorType == 'disallowedBBCodes'}
+ {lang}wcf.message.error.disallowedBBCodes{/lang}
{else}
{lang}wcf.conversation.message.error.{@$errorType}{/lang}
{/if}
{lang}wcf.global.form.error.empty{/lang}
{elseif $errorType == 'tooLong'}
{lang}wcf.message.error.tooLong{/lang}
+ {elseif $errorType == 'censoredWordsFound'}
+ {lang}wcf.message.error.censoredWordsFound{/lang}
+ {elseif $errorType == 'disallowedBBCodes'}
+ {lang}wcf.message.error.disallowedBBCodes{/lang}
{else}
{lang}wcf.conversation.message.error.{@$errorType}{/lang}
{/if}