use wcf\data\object\type\ObjectType;
use wcf\data\object\type\ObjectTypeCache;
use wcf\data\user\User;
+use wcf\event\message\MessageSpamChecking;
use wcf\system\bbcode\BBCodeHandler;
use wcf\system\captcha\CaptchaHandler;
use wcf\system\comment\CommentHandler;
use wcf\system\comment\manager\ICommentManager;
+use wcf\system\event\EventHandler;
use wcf\system\exception\NamedUserException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
use wcf\util\MessageUtil;
use wcf\util\UserRegistrationUtil;
+use wcf\util\UserUtil;
/**
* Executes comment-related actions.
if (!$this->commentProcessor->canAdd($this->parameters['data']['objectID'])) {
throw new PermissionDeniedException();
}
+
+ $event = new MessageSpamChecking(
+ $this->parameters['htmlInputProcessor'],
+ WCF::getUser()->userID ? WCF::getUser() : null,
+ UserUtil::getIpAddress(),
+ );
+ EventHandler::getInstance()->fire($event);
+ if ($event->defaultPrevented()) {
+ throw new PermissionDeniedException();
+ }
}
/**
$this->validateGetGuestDialog();
$this->validateMessage(true);
+
+ $event = new MessageSpamChecking(
+ $this->parameters['htmlInputProcessor'],
+ WCF::getUser()->userID ? WCF::getUser() : null,
+ UserUtil::getIpAddress(),
+ );
+ EventHandler::getInstance()->fire($event);
+ if ($event->defaultPrevented()) {
+ throw new PermissionDeniedException();
+ }
}
/**