@@ 975,9 975,25 @@ create_includes() {
if [[ -f $footer_file ]]; then cp "$footer_file" .footer.html
else {
- protected_mail=${global_email//@/@}
- protected_mail=${protected_mail//./.}
- echo "<div id=\"footer\">$global_license <a href=\"$global_author_url\">$global_author</a> — <a href=\"mailto:$protected_mail\">$protected_mail</a><br/>"
+ protected_mail="$(echo "$global_email" | base64)"
+ echo "<script type='text/javascript'>"
+ echo "// <!--"
+ echo "decodeBase64 = function(s) {"
+ echo "var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;"
+ echo "var A=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";"
+ echo "for(i=0;i<64;i++){e[A.charAt(i)]=i;}"
+ echo "for(x=0;x<L;x++){"
+ echo "c=e[s.charAt(x)];b=(b<<6)+c;l+=6;"
+ echo "while(l>=8){((a=(b>>>(l-=8))&0xff)||(x<(L-2)))&&(r+=w(a));}"
+ echo -e "}\nreturn r;\n};"
+ echo "document.write('<div id=\"footer\">$global_license <a href=\"$global_author_url\">$global_author</a> — <a href=\"mailto://' + decodeBase64('$protected_mail') + '\">' + decodeBase64('$protected_mail') + '</a><br/>');"
+ echo "// -->"
+ echo "</script>"
+ echo "<noscript>"
+ echo "<div id=\"footer\">Javascript is disabled. To get the email address, enable javascript or run this string through base64 -d<br />"
+ echo "<b>$protected_mail</b><br />"
+ echo "$global_license <a href=\"$global_author_url\">$global_author</a> — <b>email protected</b><br/>"
+ echo "</noscript>"
echo 'Generated with <a href="https://gitlab.com/stormdragon2976/bashtml">BasHTML</a>, a bash script to easily create blogs like this one</div>'
} >> ".footer.html"
fi