From 047c5049fe5be7b428de0fca236e46dcd1811478 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 12 Apr 2020 07:49:26 +0200 Subject: [PATCH] Plugin: BBB: Improve server host auto-correct - refs #2974 --- plugin/bbb/lib/bbb.lib.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/bbb/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index b325218cf6..cce4e32835 100755 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -107,15 +107,21 @@ class bbb } $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; }