From: Alexander Ebert Date: Wed, 14 Feb 2018 13:01:01 +0000 (+0100) Subject: Consistent representation of dynamically generated teasers X-Git-Tag: 3.1.0~32 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=61563de938a164ac6ca50d7e3cacce57f860809d;p=GitHub%2FWoltLab%2FWCF.git Consistent representation of dynamically generated teasers --- diff --git a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php index b7e267ed89..a1a3fc533c 100644 --- a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php +++ b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php @@ -80,9 +80,11 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo return nl2br(StringUtil::encodeHTML($this->teaser), false); } else { - $htmlInputProcessor = new HtmlInputProcessor(); - $htmlInputProcessor->processIntermediate($this->content); - return nl2br(StringUtil::encodeHTML(StringUtil::truncate($htmlInputProcessor->getTextContent(), 500)), false); + $htmlOutputProcessor = new HtmlOutputProcessor(); + $htmlOutputProcessor->setOutputType('text/plain'); + $htmlOutputProcessor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID, false, $this->languageID); + + return nl2br(StringUtil::encodeHTML(StringUtil::truncate($htmlOutputProcessor->getHtml(), 500)), false); } }