diff options
author | Louis Chemineau <louis@chmn.me> | 2021-09-29 16:07:08 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2021-09-29 16:45:33 +0200 |
commit | 18d32a1ce70f092fe83af07da4fe0038e3fe2a7f (patch) | |
tree | ab04c6653eda2242b6946c41373a88e3314500a9 /lib | |
parent | 5a469f54ab6877b690d585517186bb5fcf40546b (diff) | |
download | nextcloud-server-18d32a1ce70f092fe83af07da4fe0038e3fe2a7f.tar.gz nextcloud-server-18d32a1ce70f092fe83af07da4fe0038e3fe2a7f.zip |
Prevent empty base URL during installation
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/URLGenerator.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index f7fa6fa5632..511c37d2624 100644 --- a/lib/private/URLGenerator.php +++ b/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; |