use wcf\system\user\notification\object\CommentUserNotificationObject;
use wcf\system\user\notification\UserNotificationHandler;
use wcf\system\WCF;
+use wcf\util\MessageUtil;
use wcf\util\StringUtil;
/**
*/
protected function validateMessage() {
$this->readString('message', false, 'data');
+ $this->parameters['data']['message'] = MessageUtil::stripCrap($this->parameters['data']['message']);
if (empty($this->parameters['data']['message'])) {
throw new UserInputException('message');
use wcf\system\WCF;
use wcf\util\ArrayUtil;
use wcf\util\ClassUtil;
+use wcf\util\MessageUtil;
/**
* Manages quick replies and stored messages.
$parameters['data']['username'] = WCF::getUser()->username;
// pre-parse message text
+ $parameters['data']['message'] = MessageUtil::stripCrap($parameters['data']['message']);
$parameters['data']['message'] = PreParser::getInstance()->parse($parameters['data']['message'], $this->allowedBBodes);
$message = $object->create();
// unify new lines
$text = StringUtil::unifyNewlines($text);
+ // remove emoji (MySQL 5.1 does not support them)
+ $text = preg_replace('~\xF0\x9F[\x80-\xBF][\x80-\xBF]~', '', $text);
+
return $text;
}