Ticket #114 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

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.

Attachments

multiple_port.patch (0.8 kB) - added by michaeltwofish 10 months ago.

Change History

Changed 10 months ago by michaeltwofish

Changed 10 months ago by skippy

  • status changed from new to closed
  • resolution set to fixed

Thanks! I applied this patch in r1317.

Note: See TracTickets for help on using tickets.