Merge pull request #1259 from virtualtam/fix/render/strip-opengraph-description

fix: ensure HTML tags are stripped from OpenGraph description
This commit is contained in:
Aurélien Tamisier 2019-01-21 10:54:30 +01:00 committed by GitHub
commit 586a9e0065
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -21,7 +21,7 @@
<meta property="og:type" content="article" />
<meta property="og:url" content="{$index_url}?{$link.shorturl}" />
{$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
<meta property="og:description" content="{function="substr($ogDescription, 0, 300)"}" />
<meta property="og:description" content="{function="substr(strip_tags($ogDescription), 0, 300)"}" />
{if="$link.thumbnail"}
<meta property="og:image" content="{$index_url}{$link.thumbnail}" />
{/if}

View file

@ -18,7 +18,7 @@
<meta property="og:type" content="article" />
<meta property="og:url" content="{$index_url}?{$link.shorturl}" />
{$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
<meta property="og:description" content="{function="mb_substr($ogDescription, 0, 300)"}" />
<meta property="og:description" content="{function="mb_substr(strip_tags($ogDescription), 0, 300)"}" />
{if="$link.thumbnail"}
<meta property="og:image" content="{$index_url}{$link.thumbnail}" />
{/if}