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:
parent
f1ec455665
commit
1dc83700c0
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in New Issue