http: Add http_build_query wrapper

This is necessary so we can sanitize/encode inputs.
html: Replace htmlentities with htmlspecialchars
http: Use http build query

Use http::build_query instead of inline urlencode
Merge pull request #1639 from protich/issue/query-string

Sanitize query strings

Reviewed-By: Jared Hancock <jared@osticket.com>