Skip to content

Commit

Permalink
Fix iports n setup wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasites committed Mar 18, 2024
1 parent b501875 commit afe6b68
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions setup/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@
}
if (!$isCommandLine) {
$https = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : false;
$installBaseUrl = (!$https || strtolower($https) != 'on') ? 'http://' : 'https://';
$installBaseUrl .= $_SERVER['HTTP_HOST'];
if (isset($_SERVER['SERVER_PORT']) && (string)$_SERVER['SERVER_PORT'] !== '' && $_SERVER['SERVER_PORT'] !== 80) {
$installBaseUrl = str_replace(':' . $_SERVER['SERVER_PORT'], '', $installBaseUrl);
}
$installBaseUrl .= in_array($_SERVER['SERVER_PORT'], [80, 443]) ? '' : ':' . $_SERVER['SERVER_PORT'];
$url_scheme = (!$https || strtolower($https) != 'on') ? 'http://' : 'https://';
$installBaseUrl = $url_scheme;
$installBaseUrl .= parse_url($url_scheme . $_SERVER['HTTP_HOST'], PHP_URL_HOST);
$url_port = parse_url($url_scheme . $_SERVER['HTTP_HOST'], PHP_URL_PORT);
$installBaseUrl .= in_array($url_port, [null , 80, 443]) ? '' : ':' . $url_port;
$installBaseUrl .= $_SERVER['SCRIPT_NAME'];
$installBaseUrl = htmlspecialchars($installBaseUrl, ENT_QUOTES, 'utf-8');
define('MODX_SETUP_URL', $installBaseUrl);
Expand Down

0 comments on commit afe6b68

Please sign in to comment.