Prevent empty base URL during installation

Signed-off-by: Louis Chemineau <louis@chmn.me>
pull/28995/head
Louis Chemineau 4 years ago
parent 5a469f54ab
commit 18d32a1ce7
  1. 3
      lib/private/URLGenerator.php

@ -271,7 +271,8 @@ class URLGenerator implements IURLGenerator {
* @return string base url of the current request
*/
public function getBaseUrl(): string {
if ($this->baseUrl === null) {
// BaseUrl can be equal to 'http(s)://' during the first steps of the intial setup.
if ($this->baseUrl === null || $this->baseUrl === "http://" || $this->baseUrl === "https://") {
$this->baseUrl = $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT;
}
return $this->baseUrl;

Loading…
Cancel
Save