fix(installer): Strip protocol from TP_HOST to keep only hostname (#1969)

This commit is contained in:
Roman Kelesidis 2025-06-19 10:59:18 +03:00 committed by GitHub
parent ce1f35c2b5
commit 15f9948403
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -206,6 +206,12 @@ if (is_file(BB_ROOT . '.env')) {
$newValue = trim(readline()); $newValue = trim(readline());
if (!empty($newValue) || $key === 'DB_PASSWORD') { if (!empty($newValue) || $key === 'DB_PASSWORD') {
if ($key === 'TP_HOST') {
if (!preg_match('/^https?:\/\//', $newValue)) {
$newValue = 'https://' . $newValue;
}
$newValue = parse_url($newValue, PHP_URL_HOST);
}
$line = "$key=$newValue"; $line = "$key=$newValue";
$$key = $newValue; $$key = $newValue;
} else { } else {