Adds protection against XSS to messages view