Do a better job of handling the non-server, non-multiport case. Put the code in Url so that it works for other functions that call Url()

This commit is contained in:
Isaac Connor 2019-11-21 13:32:27 -05:00
parent f1ec455665
commit 1dc83700c0
1 changed files with 6 additions and 4 deletions

View File

@ -89,13 +89,15 @@ class Server extends ZM_Object {
}
public function UrlToZMS( $port = null ) {
if ( $this->Id() or $port ) {
return $this->Url($port).$this->PathToZMS();
}
return $this->PathToZMS();
return $this->Url($port).$this->PathToZMS();
}
public function Url( $port = null ) {
if ( ! ( $this->Id() or $port ) ) {
# Don't specify a hostname or port, the browser will figure it out
return '';
}
$url = $this->Protocol().'://';
$url .= $this->Hostname();
if ( $port ) {