gallery/gallery3 — pull request #201 by shadlaws (2013-03-11 10:14:22+00:00)
Title: #2049 - Fix issues with ports other than http/80 or https/443.

- prefer HTTP_POST over SERVER_NAME for getting the domain name (includes port, handles domain aliases better)
- ensure that HTTP_POST is escaped (avoids possible XSS vulnerability)