mirror of
https://github.com/torrentpier/torrentpier
synced 2025-07-05 20:41:41 -07:00
fix(installer): Strip protocol from TP_HOST to keep only hostname (#1969)
This commit is contained in:
parent
ce1f35c2b5
commit
15f9948403
1 changed files with 6 additions and 0 deletions
|
@ -206,6 +206,12 @@ if (is_file(BB_ROOT . '.env')) {
|
|||
$newValue = trim(readline());
|
||||
|
||||
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";
|
||||
$$key = $newValue;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue