diff --git a/file/lib/data/message/Message.class.php b/file/lib/data/message/Message.class.php index cefa8bb..dea41bd 100644 --- a/file/lib/data/message/Message.class.php +++ b/file/lib/data/message/Message.class.php @@ -57,7 +57,7 @@ public function __toString() { * @param string $outputType outputtype for messageparser * @return string */ - public function getFormattedMessage() { + public function getFormattedMessage($type = 'text/html') { $message = $this->message; switch ($this->type) { @@ -77,6 +77,8 @@ public function getFormattedMessage() { case self::TYPE_NORMAL: case self::TYPE_ME: default: + if ($type !== 'text/html') return $message; + $messageParser = \wcf\system\bbcode\MessageParser::getInstance(); $messageParser->setOutputType('text/html'); $message = $messageParser->parse($message, $this->enableSmilies, $this->enableHTML, true, false); @@ -133,7 +135,7 @@ public function jsonify($raw = false) { 'formattedMessage' => $this->getFormattedMessage(), 'formattedTime' => \wcf\util\DateUtil::format(\wcf\util\DateUtil::getDateTimeByTimestamp($this->time), 'H:i:s'), 'separator' => $separator, - 'message' => $this->message, + 'message' => $this->getFormattedMessage('text/plain'), 'sender' => (int) $this->sender, 'username' => $this->getUsername(), 'time' => (int) $this->time,