Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2021-09-29 17:07:08 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-09-29 18:43:28 +0300
commit072d4bb0d08627ff31f176fc8318fe2a12ef24a3 (patch)
tree2fc965a8078562e04f287c6b2eec3cd906fd6161
parentd63f6d8c18b01028910ac9d1a2e43e290d90338b (diff)
Prevent empty base URL during installation
Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r--lib/private/URLGenerator.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php
index eb9ef4e52b4..dce5f927e60 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;