htmlspecialchars() checks for type of input parameter before executing.

Fixes #1436