From: Marcel Werk Date: Thu, 12 Jan 2017 15:20:23 +0000 (+0100) Subject: Improved fallback creation of article teasers X-Git-Tag: 3.0.1~53 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=45a70ce0ac73e9a3d2f2891a6043a021471120ad;p=GitHub%2FWoltLab%2FWCF.git Improved fallback creation of article 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 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)); } }