Added htmlentities() where needed. I may have missed a few so by all means add it where you see necessary.