From 551d21022202d1b828459723da4d21951bf961fb Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 1 Feb 2017 18:26:18 +0100 Subject: [PATCH] Fixed empty description meta tag --- wcfsetup/install/files/lib/page/ArticlePage.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/page/ArticlePage.class.php b/wcfsetup/install/files/lib/page/ArticlePage.class.php index a1b1b9d0ba..ed3cb96c36 100644 --- a/wcfsetup/install/files/lib/page/ArticlePage.class.php +++ b/wcfsetup/install/files/lib/page/ArticlePage.class.php @@ -10,6 +10,7 @@ use wcf\system\like\LikeHandler; use wcf\system\request\LinkHandler; use wcf\system\MetaTagHandler; use wcf\system\WCF; +use wcf\util\StringUtil; /** * Shows a cms article. @@ -106,7 +107,7 @@ class ArticlePage extends AbstractArticlePage { MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->articleContent->getTitle() . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true); MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('Article', ['object' => $this->articleContent]), true); MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'article', true); - MetaTagHandler::getInstance()->addTag('og:description', 'og:description', $this->articleContent->teaser, true); + MetaTagHandler::getInstance()->addTag('og:description', 'og:description', ($this->articleContent->teaser ?: StringUtil::decodeHTML(StringUtil::stripHTML($this->articleContent->getFormattedTeaser()))), true); if ($this->articleContent->getImage()) { MetaTagHandler::getInstance()->addTag('og:image', 'og:image', $this->articleContent->getImage()->getLink(), true); -- 2.20.1