From: Marcel Werk Date: Wed, 1 Feb 2017 17:26:18 +0000 (+0100) Subject: Fixed empty description meta tag X-Git-Tag: 3.0.2~31 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=551d21022202d1b828459723da4d21951bf961fb;p=GitHub%2FWoltLab%2FWCF.git Fixed empty description meta tag --- 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);