Fix adding port to IPv6 addresses
Use parse_url() to check for port