refbook edit and xss protection