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:
parent
ff3b5dc554
commit
49106a5d8c
2 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
||||||
<meta property="og:type" content="article" />
|
<meta property="og:type" content="article" />
|
||||||
<meta property="og:url" content="{$index_url}?{$link.shorturl}" />
|
<meta property="og:url" content="{$index_url}?{$link.shorturl}" />
|
||||||
{$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
|
{$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"}
|
{if="$link.thumbnail"}
|
||||||
<meta property="og:image" content="{$index_url}{$link.thumbnail}" />
|
<meta property="og:image" content="{$index_url}{$link.thumbnail}" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<meta property="og:type" content="article" />
|
<meta property="og:type" content="article" />
|
||||||
<meta property="og:url" content="{$index_url}?{$link.shorturl}" />
|
<meta property="og:url" content="{$index_url}?{$link.shorturl}" />
|
||||||
{$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
|
{$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"}
|
{if="$link.thumbnail"}
|
||||||
<meta property="og:image" content="{$index_url}{$link.thumbnail}" />
|
<meta property="og:image" content="{$index_url}{$link.thumbnail}" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Reference in a new issue