cfenollosa / bashblog

A single Bash script to create blogs. Download, run, write, done!
1.66k stars 228 forks source link

Incorrect email formatting in footer #175

Open gnafuthegreat opened 1 year ago

gnafuthegreat commented 1 year ago

To my shame, it's been a year since I last posted on my blog. At some point in the last year, it seems maybe bash has changed its behavior such that bashblog isn't generating a correct email format in the footer anymore. You can see what I mean on any page here:

https://themayhaks.com/~gideon/blog/

It's adding an extra #64; and #46;, like so:

gideon@#64;themayhaks.#46;com

I'm using the same copy of bb.sh and the same .config that I used last time I updated my blog, so I'm guessing something with bash itself changed. I have upgraded Fedora a couple times in the past year, and I'm currently using 37 with bash version 5.2.9(1)-release.

Any thoughts on what I can tweak to fix the formatting of the email in the footer, or any other information I can provide to help identify a long-term fix?

gnafuthegreat commented 1 year ago

(I see the lines where it is doing a replace of some sort, but I'm not familiar enough with bash syntax to know how to tweak it to work again.)

gnafuthegreat commented 1 year ago

It looks like escaping the & is enough to get it working, like so:

        protected_mail=${global_email//@/\@}
        protected_mail=${protected_mail//./\.}

However, I'm not sure if that's the "best" way to fix it, so I hesitate to submit a PR with that change. I'll leave this open if someone would like to review and see if there's a more appropriate fix, but I'm good with this solution for now. If this is the right way to resolve the issue, please feel free to correct it without attribution (I can't imagine two backslashes are copyrightable ;-)).