Consistent representation of dynamically generated teasers
authorAlexander Ebert <ebert@woltlab.com>
Wed, 14 Feb 2018 13:01:01 +0000 (14:01 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 14 Feb 2018 13:01:01 +0000 (14:01 +0100)
wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php

index b7e267ed89fe16953862f38fa4778ea1843a11d1..a1a3fc533c2f504216aa45c22f7b0753e373f6cc 100644 (file)
@@ -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);
                }
        }