Skip to content

Commit 80d6f9e

Browse files
authored
Tighten up sanitization of seo meta. (#378)
1 parent 269d1c4 commit 80d6f9e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

resources/views/meta.antlers.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{ /if }}
88

99
{{ if robots }}
10-
<meta name="robots" content="{{ robots | raw | list }}" />
10+
<meta name="robots" content="{{ robots | raw | list | striptags | entities }}" />
1111
{{ /if }}
1212

1313
<meta property="og:type" content="website" />
@@ -37,7 +37,7 @@
3737
<meta name="twitter:card" content="{{ twitter_card }}" />
3838

3939
{{ if twitter_handle }}
40-
<meta name="twitter:site" content="{{ twitter_handle | trim | ensure_left:@ }}" />
40+
<meta name="twitter:site" content="{{ twitter_handle | striptags | entities | trim | ensure_left:@ }}" />
4141
{{ /if }}
4242

4343
{{ if title }}
@@ -62,7 +62,7 @@
6262
<meta property="og:image:width" content="{{ width }}" />
6363
<meta property="og:image:height" content="{{ height }}" />
6464
{{ /if }}
65-
<meta property="og:image:alt" content="{{ alt }}" />
65+
<meta property="og:image:alt" content="{{ alt | striptags | entities }}" />
6666

6767
{{ if is_twitter_glide_enabled }}
6868
{{ glide:generate :src="image" preset="seo_pro_twitter" absolute="true" }}
@@ -71,7 +71,7 @@
7171
{{ else }}
7272
<meta name="twitter:image" content="{{ permalink }}" />
7373
{{ /if }}
74-
<meta name="twitter:image:alt" content="{{ alt }}" />
74+
<meta name="twitter:image:alt" content="{{ alt | striptags | entities }}" />
7575

7676
{{ /image }}
7777
{{ /if }}
@@ -99,9 +99,9 @@
9999
{{ /if }}
100100

101101
{{ if google_verification }}
102-
<meta name="google-site-verification" content="{{ google_verification }}" />
102+
<meta name="google-site-verification" content="{{ google_verification | striptags | entities }}" />
103103
{{ /if }}
104104

105105
{{ if bing_verification }}
106-
<meta name="msvalidate.01" content="{{ bing_verification }}" />
106+
<meta name="msvalidate.01" content="{{ bing_verification | striptags | entities }}" />
107107
{{ /if }}

0 commit comments

Comments
 (0)