php - Port Number Being Repeated Twice? -
i have small bug in construction of url, i've setup test when not using port:80
, reason if use port:8080
applying port number twice
reason in code cant explain it.
public function get_full_url() { /** $_server **/ $server = self::get('server'); $page_url = 'http'; if(isset($server['https']) , $server['https'] == 'on') { $page_url .= 's'; } $site_domain = (isset($server['http_host']) , trim($server['http_host']) != '') ? $server['http_host'] : $server['server_name']; $page_url .= '://'; if($server['server_port'] != '80') { $page_url .= $site_domain.':'.$server['server_port'].$server['request_uri']; } else { $page_url .= $site_domain.$server['request_uri']; } return $page_url; }
$_server['http_host']
contain port number set in host:
header
Comments
Post a Comment