aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2024-11-21 13:08:14 +0100
committerGitHub <noreply@github.com>2024-11-21 13:08:14 +0100
commit09ad3951e34cbdc4c3748681946f13476b52cfd4 (patch)
treebe3865715be7c48f8ac0c0d0b6c1aedbc4b94098 /apps
parent2ebcfad1ee60f3cbae743e13e5427b96866f7841 (diff)
parent50d071e7d211cd46fdcd8cd349a5e9028e54bf77 (diff)
downloadnextcloud-server-09ad3951e34cbdc4c3748681946f13476b52cfd4.tar.gz
nextcloud-server-09ad3951e34cbdc4c3748681946f13476b52cfd4.zip
Merge pull request #49373 from nextcloud/backportArrayKeySetupCheks
fix(SetupChecks): Make sure array key is set
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/SetupChecks/CheckServerResponseTrait.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php b/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php
index 3080829cb00..4c7635c5897 100644
--- a/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php
+++ b/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php
@@ -93,6 +93,10 @@ trait CheckServerResponseTrait {
protected function normalizeUrl(string $url, bool $removeWebroot): string {
if ($removeWebroot) {
$segments = parse_url($url);
+ if (!isset($segments['scheme']) || !isset($segments['host'])) {
+ throw new \InvalidArgumentException('URL is missing scheme or host');
+ }
+
$port = isset($segments['port']) ? (':' . $segments['port']) : '';
return $segments['scheme'] . '://' . $segments['host'] . $port;
}