Merge pull request #49424 from nextcloud/backport/49373/stable29

[stable29] fix(SetupChecks): Make sure array key is set
This commit is contained in:
Git'Fellow 2024-11-23 02:36:14 +01:00 committed by GitHub
commit f84a7a0cf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,6 +110,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;
}