change paramter calls of htmlentities to allow invalid code to be replaced instead of returning empty string