From e1a59b1e1c6fdf328b58fa7c08e0ff68b35988f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Thu, 30 May 2019 21:31:31 +0200 Subject: [PATCH] Encode JSON variables in AMP article page --- com.woltlab.wcf/templates/ampArticle.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/com.woltlab.wcf/templates/ampArticle.tpl b/com.woltlab.wcf/templates/ampArticle.tpl index a9979f5ce7..8ca0e21537 100644 --- a/com.woltlab.wcf/templates/ampArticle.tpl +++ b/com.woltlab.wcf/templates/ampArticle.tpl @@ -5,21 +5,21 @@ { "@context": "http://schema.org", "@type": "NewsArticle", - "mainEntityOfPage": "{$regularCanonicalURL}", - "headline": "{$articleContent->title}", + "mainEntityOfPage": "{@$regularCanonicalURL|encodeJSON}", + "headline": "{@$articleContent->title|encodeJSON}", "datePublished": "{@$article->time|date:'c'}", "dateModified": "{@$article->time|date:'c'}", - "description": "{@$articleContent->getFormattedTeaser()}", + "description": "{@$articleContent->getFormattedTeaser()|encodeJSON}", "author": { "@type": "Person", - "name": "{$article->username}" + "name": "{@$article->username|encodeJSON}" }, "publisher": { "@type": "Organization", "name": "{PAGE_TITLE|language}", "logo": { "@type": "ImageObject", - "url": "{$__wcf->getStyleHandler()->getStyle()->getPageLogo()}", + "url": "{@$__wcf->getStyleHandler()->getStyle()->getPageLogo()|encodeJSON}", "width": {@$__wcf->getStyleHandler()->getStyle()->getVariable('pageLogoWidth')}, "height": {@$__wcf->getStyleHandler()->getStyle()->getVariable('pageLogoHeight')} } @@ -27,7 +27,7 @@ {if $articleContent->getImage()} ,"image": { "@type": "ImageObject", - "url": "{$articleContent->getImage()->getThumbnailLink('large')}", + "url": "{@$articleContent->getImage()->getThumbnailLink('large')|encodeJSON}", "width": {@$articleContent->getImage()->getThumbnailWidth('large')}, "height": {@$articleContent->getImage()->getThumbnailHeight('large')} } -- 2.20.1