Article teaser was incorrectly formatted when automatically generated from the articl...
authorMarcel Werk <burntime@woltlab.com>
Tue, 5 Apr 2022 14:06:13 +0000 (16:06 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 5 Apr 2022 14:06:13 +0000 (16:06 +0200)
wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php

index 5bc65c472f1fe71d803cd0aaaeef33e47e0b8b09..ba648fba1156aa92cbcb9a5b7a656e7701fc2cc7 100644 (file)
@@ -12,6 +12,7 @@ use wcf\system\language\LanguageFactory;
 use wcf\system\request\IRouteController;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
+use wcf\util\MessageUtil;
 use wcf\util\StringUtil;
 
 /**
@@ -88,7 +89,7 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo
             return \nl2br(StringUtil::encodeHTML($this->teaser), false);
         } else {
             $htmlOutputProcessor = new HtmlOutputProcessor();
-            $htmlOutputProcessor->setOutputType('text/plain');
+            $htmlOutputProcessor->setOutputType('text/simplified-html');
             $htmlOutputProcessor->enableUgc = false;
             $htmlOutputProcessor->process(
                 $this->content,
@@ -98,7 +99,7 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo
                 $this->languageID
             );
 
-            return \nl2br(StringUtil::encodeHTML(StringUtil::truncate($htmlOutputProcessor->getHtml(), 500)), false);
+            return MessageUtil::truncateFormattedMessage($htmlOutputProcessor->getHtml(), 500);
         }
     }