Skip to content

Commit e5ba5f8

Browse files
authored
Sanitize urls. (#380)
1 parent e464add commit e5ba5f8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

resources/views/meta.antlers.html

Lines changed: 12 additions & 12 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 | striptags | entities }}" />
10+
<meta name="robots" content="{{ robots | raw | list | striptags | entities | trim }}" />
1111
{{ /if }}
1212

1313
<meta property="og:type" content="website" />
@@ -20,7 +20,7 @@
2020
<meta property="og:description" content="{{ description | striptags | entities | trim }}" />
2121
{{ /if }}
2222

23-
<meta property="og:url" content="{{ canonical_url }}" />
23+
<meta property="og:url" content="{{ canonical_url | striptags | entities | trim }}" />
2424

2525
{{ if site_name }}
2626
<meta property="og:site_name" content="{{ site_name | striptags | entities | trim }}" />
@@ -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 | striptags | entities }}" />
65+
<meta property="og:image:alt" content="{{ alt | striptags | entities | trim }}" />
6666

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

7676
{{ /image }}
7777
{{ /if }}
7878

79-
<link href="{{ home_url }}" rel="home" />
80-
<link href="{{ canonical_url }}" rel="canonical" />
79+
<link href="{{ home_url | striptags | entities | trim }}" rel="home" />
80+
<link href="{{ canonical_url | striptags | entities | trim }}" rel="canonical" />
8181

8282
{{ if prev_url }}
83-
<link href="{{ prev_url }}" rel="prev" />
83+
<link href="{{ prev_url | striptags | entities | trim }}" rel="prev" />
8484
{{ /if }}
8585

8686
{{ if next_url }}
87-
<link href="{{ next_url }}" rel="next" />
87+
<link href="{{ next_url | striptags | entities | trim }}" rel="next" />
8888
{{ /if }}
8989

9090
{{ if alternate_locales }}
91-
<link rel="alternate" href="{{ canonical_url }}" hreflang="{{ current_hreflang }}" />
91+
<link rel="alternate" href="{{ canonical_url | striptags | entities | trim }}" hreflang="{{ current_hreflang }}" />
9292
{{ alternate_locales }}
93-
<link rel="alternate" href="{{ url }}" hreflang="{{ hreflang }}" />
93+
<link rel="alternate" href="{{ url | striptags | entities | trim }}" hreflang="{{ hreflang }}" />
9494
{{ /alternate_locales }}
9595
{{ /if }}
9696

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

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

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

0 commit comments

Comments
 (0)