Reflecting API changes
authorMarcel Werk <burntime@woltlab.com>
Wed, 6 Feb 2013 00:48:57 +0000 (01:48 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 6 Feb 2013 00:48:57 +0000 (01:48 +0100)
files/lib/data/conversation/message/ConversationMessage.class.php

index 21caf4d75b043b507f6cd1c36824e4b909e1621a..1474fd4fa3cdf7dea7d930c9a014703b76052146 100644 (file)
@@ -80,16 +80,10 @@ class ConversationMessage extends DatabaseObject implements IMessage {
         * @return      string
         */
        public function getExcerpt($maxLength = 255) {
-               MessageParser::getInstance()->setOutputType('text/plain');
+               MessageParser::getInstance()->setOutputType('text/simplified-html');
                $message = MessageParser::getInstance()->parse($this->message, $this->enableSmilies, $this->enableHtml, $this->enableBBCodes);
-               if (StringUtil::length($message) > $maxLength) {
-                       $message = StringUtil::encodeHTML(StringUtil::substring($message, 0, $maxLength)).StringUtil::HELLIP;
-               }
-               else {
-                       $message = StringUtil::encodeHTML($message);
-               }
                
-               return $message;
+               return StringUtil::truncateHTML($message, $maxLength);
        }
        
        /**