diff --git a/web/includes/Server.php b/web/includes/Server.php index 502d0efa5..aba82e79e 100644 --- a/web/includes/Server.php +++ b/web/includes/Server.php @@ -51,13 +51,8 @@ class Server { } else if ( $this->Id() ) { return $this->{'Name'}; } - # Use HTTP_HOST instead of SERVER_NAME here for nginx compatiblity - # ICON: Hi, I just met you, and this is crazy, but I need to strip port. - $host_with_port_maybe = $_SERVER['HTTP_HOST']; - $heres_my_host = preg_replace('/([^:]+)(:\d+)?/','${1}', $host_with_port_maybe); - #Just use it baby - - return $heres_my_host; + $result = explode(':',$_SERVER['HTTP_HOST']); + return $result[0]; } public function Protocol( $new = null ) { @@ -96,12 +91,7 @@ class Server { public function Url( $port = null ) { $url = $this->Protocol().'://'; - if ( $this->Id() ) { - $url .= $this->Hostname(); - } else { - # Use HTTP_HOST instead of SERVER_NAME here for nginx compatiblity - $url .= $_SERVER['HTTP_HOST']; - } + $url .= $this->Hostname(); if ( $port ) { $url .= ':'.$port; } else {