Ticket #114 (closed defect: fixed)
Extra port is added when running on non-standard port
| Reported by: | michaeltwofish | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.4 |
| Component: | Habari Core Software | Version: | SVN |
| Keywords: | Cc: |
Description
In system/classes/site.php in get_url() Habari adds the port from $_SERVERSERVER_PORT? to the url if it is not a standard port (80 or 443). However, $_SERVERHTTP_HOST? already contains the port, so the port is repeated (for example http://localhost:8888:8888 on a standard MAMP install).
I'm not sure under what circumstances the port is _not_ in $_SERVERHTTP_HOST?, so in the attached patch I only add the port if it's not already in $_SERVERHTTP_HOST?. However, it may be that the addition of the port is redundant in all cases and the port code can be removed.
Note that in some browsers (for example Firefox and Camino) the double port is rewritten, and the problem doesn't show up. Other browsers (Safari) don't, and the site doesn't run.
