Fixed warning about passing references to sanitizeHTML()

It seems that sanitizeHTML() requires a variable to be passed else PHP
will show a warning in the log.

This commit moves the relevant values into variables first.
Now caling translation function for JS messages