Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Laura i Domiś
HTTP.sh
Commits
a9a2d8da
Commit
a9a2d8da
authored
Jun 24, 2021
by
Lauren N. Liberda
Browse files
head: html escape meta tag contents
parent
911eca71
Pipeline
#424
failed with stage
in 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
templates/head.sh
View file @
a9a2d8da
...
...
@@ -4,20 +4,20 @@ echo '<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">'
if
[[
${
meta
[title]
}
]]
;
then
echo
"<title>
${
meta
[title]
}
-
${
cfg
[title]
}
</title>"
;
else
echo
"<title>
${
cfg
[title]
}
</title>"
;
fi
if
[[
${
meta
[author]
}
]]
;
then
echo
"<meta name='author' content='
${
meta
[author]
}
'>"
;
fi
if
[[
${
meta
[description]
}
]]
;
then
echo
"<meta name='description' content='
${
meta
[description]
}
'>"
;
fi
if
[[
${
meta
[keywords]
}
]]
;
then
echo
"<meta name='keywords' content='
${
meta
[keywords]
}
'>"
;
fi
if
[[
${
meta
[refresh]
}
]]
;
then
echo
"<meta http-equiv='refresh' content='
${
meta
[refresh]
}
'>"
;
fi
if
[[
${
meta
[redirect]
}
]]
;
then
echo
"<meta http-equiv='refresh' content='0; URL=
${
meta
[redirect]
}
'>"
;
fi
if
[[
${
meta
[css]
}
]]
;
then
echo
"<link rel='stylesheet' type='text/css' href='
${
meta
[css]
}
'/>"
;
fi
if
[[
${
meta
[title]
}
]]
;
then
echo
"<meta property='og:title' content='
${
meta
[title]
}
'>"
;
fi
#if [[ ${meta[og:type]} ]]; then echo "<meta property='og:type' content='${meta[og:type]}'>"; fi
if
[[
${
cfg
[url]
}
]]
;
then
echo
"<meta property='og:url' content='
${
cfg
[url]
}
'>"
;
fi
#if [[ ${meta[og:image} ]]; then echo "<meta property='og:image' content='${meta[og:image]}'>"; fi
if
[[
${
meta
[lang]
}
]]
;
then
echo
"<meta property='og:locale' content='
${
meta
[lang]
}
'>"
;
fi
if
[[
${
meta
[description]
}
]]
;
then
echo
"<meta property='og:description' content='
${
meta
[description]
}
'>"
;
fi
if
[[
${
meta
[unsafe]
}
]]
;
then
echo
"
${
meta
[unsafe]
}
"
;
fi
if
[[
"
${
meta
[title]
}
"
!=
""
]]
;
then
echo
"<title>
$
(
html_encode
"
$
{
meta
[title]
}
"
)
-
${
cfg
[title]
}
</title>"
;
else
echo
"<title>
${
cfg
[title]
}
</title>"
;
fi
if
[[
"
${
meta
[author]
}
"
!=
""
]]
;
then
echo
"<meta name='author' content='
$
(
html_encode
"
$
{
meta
[author]
}
"
)
'>"
;
fi
if
[[
"
${
meta
[description]
}
"
!=
""
]]
;
then
echo
"<meta name='description' content='
$
(
html_encode
"
$
{
meta
[description]
}
"
)
'>"
;
fi
if
[[
"
${
meta
[keywords]
}
"
!=
""
]]
;
then
echo
"<meta name='keywords' content='
$
(
html_encode
"
$
{
meta
[keywords]
}
"
)
'>"
;
fi
if
[[
"
${
meta
[refresh]
}
"
!=
""
]]
;
then
echo
"<meta http-equiv='refresh' content='
$
(
html_encode
"
$
{
meta
[refresh]
}
"
)
'>"
;
fi
if
[[
"
${
meta
[redirect]
}
"
!=
""
]]
;
then
echo
"<meta http-equiv='refresh' content='0; URL=
$
(
html_encode
"
$
{
meta
[redirect]
}
"
)
'>"
;
fi
if
[[
"
${
meta
[css]
}
"
!=
""
]]
;
then
echo
"<link rel='stylesheet' type='text/css' href='
$
(
html_encode
"
$
{
meta
[css]
}
"
)
'/>"
;
fi
if
[[
"
${
meta
[title]
}
"
!=
""
]]
;
then
echo
"<meta property='og:title' content='
$
(
html_encode
"
$
{
meta
[title]
}
"
)
'>"
;
fi
#if [[
"
${meta[og:type]}
" != ""
]]; then echo "<meta property='og:type' content='${meta[og:type]}'>"; fi
if
[[
"
${
cfg
[url]
}
"
!=
""
]]
;
then
echo
"<meta property='og:url' content='
$
(
html_encode
"
$
{
cfg
[url]
}
"
)
'>"
;
fi
#if [[
"
${meta[og:image}
" != ""
]]; then echo "<meta property='og:image' content='${meta[og:image]}'>"; fi
if
[[
"
${
meta
[lang]
}
"
!=
""
]]
;
then
echo
"<meta property='og:locale' content='
$
(
html_encode
"
$
{
meta
[lang]
}
"
)
'>"
;
fi
if
[[
"
${
meta
[description]
}
"
!=
""
]]
;
then
echo
"<meta property='og:description' content='
$
(
html_encode
"
$
{
meta
[description]
}
"
)
'>"
;
fi
if
[[
"
${
meta
[unsafe]
}
"
!=
""
]]
;
then
echo
"
${
meta
[unsafe]
}
"
;
fi
echo
"<style>
body {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment