From a9a2d8da257cb326f7fbe893bbf3d8729383f9f9 Mon Sep 17 00:00:00 2001 From: Lauren Liberda Date: Thu, 24 Jun 2021 01:01:13 +0200 Subject: [PATCH] head: html escape meta tag contents --- templates/head.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/templates/head.sh b/templates/head.sh index 7ac0e33..2b4b1e5 100755 --- a/templates/head.sh +++ b/templates/head.sh @@ -4,20 +4,20 @@ echo ' ' -if [[ ${meta[title]} ]]; then echo "${meta[title]} - ${cfg[title]}"; else echo "${cfg[title]}"; fi -if [[ ${meta[author]} ]]; then echo ""; fi -if [[ ${meta[description]} ]]; then echo ""; fi -if [[ ${meta[keywords]} ]]; then echo ""; fi -if [[ ${meta[refresh]} ]]; then echo ""; fi -if [[ ${meta[redirect]} ]]; then echo ""; fi -if [[ ${meta[css]} ]]; then echo ""; fi -if [[ ${meta[title]} ]]; then echo ""; fi -#if [[ ${meta[og:type]} ]]; then echo ""; fi -if [[ ${cfg[url]} ]]; then echo ""; fi -#if [[ ${meta[og:image} ]]; then echo ""; fi -if [[ ${meta[lang]} ]]; then echo ""; fi -if [[ ${meta[description]} ]]; then echo ""; fi -if [[ ${meta[unsafe]} ]]; then echo "${meta[unsafe]}"; fi +if [[ "${meta[title]}" != "" ]]; then echo "$(html_encode "${meta[title]}") - ${cfg[title]}"; else echo "${cfg[title]}"; fi +if [[ "${meta[author]}" != "" ]]; then echo ""; fi +if [[ "${meta[description]}" != "" ]]; then echo ""; fi +if [[ "${meta[keywords]}" != "" ]]; then echo ""; fi +if [[ "${meta[refresh]}" != "" ]]; then echo ""; fi +if [[ "${meta[redirect]}" != "" ]]; then echo ""; fi +if [[ "${meta[css]}" != "" ]]; then echo ""; fi +if [[ "${meta[title]}" != "" ]]; then echo ""; fi +#if [[ "${meta[og:type]}" != "" ]]; then echo ""; fi +if [[ "${cfg[url]}" != "" ]]; then echo ""; fi +#if [[ "${meta[og:image}" != "" ]]; then echo ""; fi +if [[ "${meta[lang]}" != "" ]]; then echo ""; fi +if [[ "${meta[description]}" != "" ]]; then echo ""; fi +if [[ "${meta[unsafe]}" != "" ]]; then echo "${meta[unsafe]}"; fi echo "