Skip to content

Commit

Permalink
Plugin: BBB: Improve server host auto-correct - refs #2974
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarnier committed Apr 12, 2020
1 parent fb69657 commit 047c504
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugin/bbb/lib/bbb.lib.php
Expand Up @@ -107,15 +107,21 @@ public function __construct(
}

$this->salt = $bbb_salt;
if (substr($bbb_host, -1, 1) !== '/') {
$bbb_host .= '/';
}
$info = parse_url($bbb_host);
$this->url = $bbb_host.'/bigbluebutton/';
if (!preg_match('#/bigbluebutton/$#', $bbb_host)) {
$bbb_host .= 'bigbluebutton/';
}
$this->url = $bbb_host;

if (isset($info['scheme'])) {
$this->protocol = $info['scheme'].'://';
$this->url = str_replace($this->protocol, '', $this->url);
$urlWithProtocol = $bbb_host;
} else {
// We asume it's an http, if user wants to use https host must include the protocol.
// We assume it's an http, if user wants to use https, the host *must* include the protocol.
$urlWithProtocol = 'http://'.$bbb_host;
}

Expand Down

0 comments on commit 047c504

Please sign in to comment.