aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2019-01-18 22:58:09 +0100
committerVirtualTam <virtualtam@flibidi.net>2019-02-23 16:28:01 +0100
commit2c16e8e9a80dae221a9d7a1907f37129ee3bc2a1 (patch)
tree6e5a299fbefd2f14292a79e800124705587fd3ca /tpl
parent43c77f658a905e2def6aeca4c092683977cd0c55 (diff)
downloadShaarli-2c16e8e9a80dae221a9d7a1907f37129ee3bc2a1.tar.gz
Shaarli-2c16e8e9a80dae221a9d7a1907f37129ee3bc2a1.tar.zst
Shaarli-2c16e8e9a80dae221a9d7a1907f37129ee3bc2a1.zip
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>
Diffstat (limited to 'tpl')
-rw-r--r--tpl/default/includes.html2
-rw-r--r--tpl/vintage/includes.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/tpl/default/includes.html b/tpl/default/includes.html
index 0427e224..6c30d1bf 100644
--- a/tpl/default/includes.html
+++ b/tpl/default/includes.html
@@ -21,7 +21,7 @@
21 <meta property="og:type" content="article" /> 21 <meta property="og:type" content="article" />
22 <meta property="og:url" content="{$index_url}?{$link.shorturl}" /> 22 <meta property="og:url" content="{$index_url}?{$link.shorturl}" />
23 {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description} 23 {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
24 <meta property="og:description" content="{function="substr($ogDescription, 0, 300)"}" /> 24 <meta property="og:description" content="{function="substr(strip_tags($ogDescription), 0, 300)"}" />
25 {if="$link.thumbnail"} 25 {if="$link.thumbnail"}
26 <meta property="og:image" content="{$index_url}{$link.thumbnail}" /> 26 <meta property="og:image" content="{$index_url}{$link.thumbnail}" />
27 {/if} 27 {/if}
diff --git a/tpl/vintage/includes.html b/tpl/vintage/includes.html
index df093495..2efb6b10 100644
--- a/tpl/vintage/includes.html
+++ b/tpl/vintage/includes.html
@@ -18,7 +18,7 @@
18 <meta property="og:type" content="article" /> 18 <meta property="og:type" content="article" />
19 <meta property="og:url" content="{$index_url}?{$link.shorturl}" /> 19 <meta property="og:url" content="{$index_url}?{$link.shorturl}" />
20 {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description} 20 {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description}
21 <meta property="og:description" content="{function="mb_substr($ogDescription, 0, 300)"}" /> 21 <meta property="og:description" content="{function="mb_substr(strip_tags($ogDescription), 0, 300)"}" />
22 {if="$link.thumbnail"} 22 {if="$link.thumbnail"}
23 <meta property="og:image" content="{$index_url}{$link.thumbnail}" /> 23 <meta property="og:image" content="{$index_url}{$link.thumbnail}" />
24 {/if} 24 {/if}