fix the lack of /zm/index.php in url in Server->Url() and multiport

This commit is contained in:
Isaac Connor 2018-10-08 09:55:47 -04:00
parent 1eb8e9ed9e
commit 52b1439d51
2 changed files with 10 additions and 5 deletions

View File

@ -547,7 +547,7 @@ private $control_fields = array(
} // end function Source
public function Url() {
return $this->Server()->Url() .':'. ( ZM_MIN_STREAMING_PORT ? (ZM_MIN_STREAMING_PORT+$this->Id()) : $_SERVER['SERVER_PORT'] );
return $this->Server()->Url( ZM_MIN_STREAMING_PORT ? (ZM_MIN_STREAMING_PORT+$this->Id()) : null );
}
} // end class Monitor

View File

@ -38,13 +38,18 @@ class Server {
}
}
public function Url() {
public function Url( $port = null ) {
$url = ZM_BASE_PROTOCOL . '://';
if ( $this->Id() ) {
return ZM_BASE_PROTOCOL . '://'. $this->Hostname().$_SERVER['PHP_SELF'];
$url .= $this->Hostname();
} else {
return ZM_BASE_PROTOCOL . '://'. $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
return '';
$url .= $_SERVER['SERVER_NAME'];
}
if ( $port ) {
$url .= ':'.$port;
}
$url .= $_SERVER['PHP_SELF'];
return $url;
}
public function Hostname() {
if ( isset( $this->{'Hostname'} ) and ( $this->{'Hostname'} != '' ) ) {