From: Joshua Rüsweg Date: Thu, 30 May 2019 19:31:31 +0000 (+0200) Subject: Encode JSON variables in AMP article page X-Git-Tag: 5.2.0_Alpha_1~19^2~2^2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e1a59b1e1c6fdf328b58fa7c08e0ff68b35988f6;p=GitHub%2FWoltLab%2FWCF.git Encode JSON variables in AMP article page --- 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')} }