use wcf\data\IMessageQuoteAction;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
+use wcf\system\message\censorship\Censorship;
use wcf\system\message\quote\MessageQuoteManager;
use wcf\system\message\QuickReplyManager;
use wcf\system\request\LinkHandler;
/**
* @see wcf\data\IMessageQuickReplyAction::validateMessage()
*/
- public function validateMessage(DatabaseObject $container, $message) { }
+ public function validateMessage(DatabaseObject $container, $message) {
+ // search for censored words
+ if (ENABLE_CENSORSHIP) {
+ $result = Censorship::getInstance()->test($message);
+ if ($result) {
+ throw new UserInputException('message', 'wcf.message.error.censoredWordsFound', array('censoredWords' => $result));
+ }
+ }
+ }
/**
* @see wcf\data\IMessageQuickReply::getPageNo()
<small class="innerError">
{if $errorType == 'empty'}
{lang}wcf.global.form.error.empty{/lang}
+ {elseif $errorType == 'censoredWordsFound'}
+ {lang}wcf.message.error.censoredWordsFound{/lang}
{else}
{lang}wcf.conversation.subject.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}
{else}
{lang}wcf.conversation.message.error.{@$errorType}{/lang}
{/if}