If htmlspecialchars needs to be run over the unparse output, perhaps that should be done in that function rather than here?