I fixed the parts you spotted in the way you suggested. One file is marked as safe, but the other one (attached) is still vulnerable.
I did make changes where I could, but I don't know what else is needed to be done. Could you kindly advise me, please?
Thank you for you help.