Skip to content

Commit

Permalink
Prevent empty base URL during installation
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge authored and backportbot[bot] committed Sep 29, 2021
1 parent 610bc60 commit 33685c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/URLGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ public function linkToDocs(string $key): string {
* @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;
Expand Down

0 comments on commit 33685c5

Please sign in to comment.