]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent empty base URL during installation 28995/head
authorLouis Chemineau <louis@chmn.me>
Wed, 29 Sep 2021 14:07:08 +0000 (16:07 +0200)
committerLouis Chemineau <louis@chmn.me>
Wed, 29 Sep 2021 14:45:33 +0000 (16:45 +0200)
Signed-off-by: Louis Chemineau <louis@chmn.me>
lib/private/URLGenerator.php

index f7fa6fa56322a7fe4c2edf3dde6cd2d8f1d884b8..511c37d26240aaf507524f56329e15ad482a8e60 100644 (file)
@@ -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;