Skip to content

Commit

Permalink
Fix in setup process
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasites committed Mar 18, 2024
1 parent 5bc6373 commit b501875
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions setup/includes/config/modconfigreader.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,9 @@ public function loadDefaults(array $config = array()) {
public function getHttpHost() {
if (php_sapi_name() != 'cli') {
$this->config['https_port'] = isset($_POST['httpsport']) ? $_POST['httpsport'] : 443;
$isSecureRequest = ((isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') || $_SERVER['SERVER_PORT'] == $this->config['https_port']);
$this->config['http_host'] = $_SERVER['HTTP_HOST'];
if ($_SERVER['SERVER_PORT'] != 80) {
$this->config['http_host'] = str_replace(':' . $_SERVER['SERVER_PORT'], '', $this->config['http_host']);
}
$this->config['http_host'] .= in_array($_SERVER['SERVER_PORT'], [80, 443]) ? '' : ':' . $_SERVER['SERVER_PORT'];
$this->config['http_host'] = parse_url('http://' . $_SERVER['HTTP_HOST'], PHP_URL_HOST);
$this->config['http_port'] = parse_url('http://' . $_SERVER['HTTP_HOST'], PHP_URL_PORT);
$this->config['http_host'] .= in_array($this->config['http_port'], [null , 80, 443]) ? '' : ':' . $this->config['http_port'];
} else {
$this->config['http_host'] = 'localhost';
$this->config['https_port'] = 443;
Expand Down

0 comments on commit b501875

Please sign in to comment.