Stop using `|encodeJSON`
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 20 Jan 2022 10:50:19 +0000 (11:50 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 20 Jan 2022 10:56:23 +0000 (11:56 +0100)
com.woltlab.wcf/templates/ampArticle.tpl
com.woltlab.wcf/templates/headIncludeJsonLd.tpl

index dff84764197b3c2f58df70e53b41bafd8b14022e..5c6d786804005e6d2a69c06c44df0ec0fd69ff43 100644 (file)
@@ -9,21 +9,21 @@
                {
                        "@context": "http://schema.org",
                        "@type": "NewsArticle",
-                       "mainEntityOfPage": "{@$regularCanonicalURL|encodeJSON}",
-                       "headline": "{@$articleContent->title|encodeJSON}",
+                       "mainEntityOfPage": {@$regularCanonicalURL|json},
+                       "headline": {@$articleContent->title|json},
                        "datePublished": "{@$article->time|date:'c'}",
                        "dateModified": "{@$article->time|date:'c'}",
-                       "description": "{@$articleContent->getFormattedTeaser()|encodeJSON}",
+                       "description": {@$articleContent->getFormattedTeaser()|json},
                        "author": {
                                "@type": "Person",
-                               "name": "{@$article->username|encodeJSON}"
+                               "name": {@$article->username|json}
                        },
                        "publisher": {
                                "@type": "Organization",
                                "name": "{PAGE_TITLE|language}",
                                "logo": {
                                        "@type": "ImageObject",
-                                       "url": "{@$__wcf->getStyleHandler()->getStyle()->getPageLogo()|encodeJSON}",
+                                       "url": {@$__wcf->getStyleHandler()->getStyle()->getPageLogo()|json},
                                        "width": {@$__wcf->getStyleHandler()->getStyle()->getVariable('pageLogoWidth')},
                                        "height": {@$__wcf->getStyleHandler()->getStyle()->getVariable('pageLogoHeight')}
                                }
@@ -31,7 +31,7 @@
                        {if $articleContent->getImage()}
                        ,"image": {
                                "@type": "ImageObject",
-                               "url": "{@$articleContent->getImage()->getThumbnailLink('large')|encodeJSON}",
+                               "url": {@$articleContent->getImage()->getThumbnailLink('large')|json},
                                "width": {@$articleContent->getImage()->getThumbnailWidth('large')},
                                "height": {@$articleContent->getImage()->getThumbnailHeight('large')}
                        }
index 7c66ef34fd8250ac84b2c8718ffa9966a0d2bc07..48931de3d53634b4261b137d15e96cc109143296 100644 (file)
@@ -4,10 +4,10 @@
 {
 "@context": "http://schema.org",
 "@type": "WebSite",
-"url": "{@$__websiteUrl|encodeJSON}",
+"url": {@$__websiteUrl|json},
 "potentialAction": {
 "@type": "SearchAction",
-"target": "{@$__searchTargetUrl|encodeJSON}",
+"target": {@$__searchTargetUrl|json},
 "query-input": "required name=search_term_string"
 }
 }