From 45a70ce0ac73e9a3d2f2891a6043a021471120ad Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 12 Jan 2017 16:20:23 +0100 Subject: [PATCH] Improved fallback creation of article teasers --- .../files/lib/data/article/content/ArticleContent.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 2de78a101f..d25ec43b58 100644 --- a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php +++ b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php @@ -4,6 +4,7 @@ use wcf\data\article\Article; use wcf\data\language\Language; use wcf\data\DatabaseObject; use wcf\data\ILinkableObject; +use wcf\system\html\input\HtmlInputProcessor; use wcf\system\html\output\AmpHtmlOutputProcessor; use wcf\system\html\output\HtmlOutputProcessor; use wcf\system\language\LanguageFactory; @@ -78,7 +79,9 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo return StringUtil::encodeHTML($this->teaser); } else { - return StringUtil::truncateHTML(StringUtil::stripHTML($this->getFormattedContent())); + $htmlInputProcessor = new HtmlInputProcessor(); + $htmlInputProcessor->processIntermediate($this->content); + return StringUtil::encodeHTML(StringUtil::truncate($htmlInputProcessor->getTextContent(), 500)); } } -- 2.20.1