Fix for XSS vulnerabilities (part 2)

Also some XSS vulnerabilities with $_POST