fix: ensure HTML tags are stripped from OpenGraph description

Fixes https://github.com/shaarli/Shaarli/issues/1250
Relates to https://github.com/shaarli/Shaarli/issues/1242

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
VirtualTam 2019-01-18 22:58:09 +01:00
parent ff3b5dc554
commit 49106a5d8c
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}