zendframework/zf2 — pull request #2249 by heiglandreas (2012-08-28 06:22:43+00:00)
Title: Fix for ZF2-499

This PR adds some lines to check for IPv6-Address in $_SERVER['SERVER_NAME'].

If SERVER_NAME starts and ends with a square bracket and only contains hexadecimals and colons this is assumed to be an IPv6-Address. The host is then set using the SERVER_ADDR as that is correct.

If the SERVER_PORT matches the digits after the last colon of SERVER_ADDR the port has been scrambled and is removed so that the default port can be set. If the SERVER_PORT is different nothing will be changed.