From 5fe49bfaf923af17b7cb52624b58c4737dbc95b0 Mon Sep 17 00:00:00 2001 From: Robert Riebisch <15858666+bttrx@users.noreply.github.com> Date: Sat, 29 Oct 2022 16:49:09 +0200 Subject: [PATCH] remove :443 for HTTPS --- install.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install.php b/install.php index d414e42..aff0c19 100644 --- a/install.php +++ b/install.php @@ -104,11 +104,13 @@ class Settings if ($dir == '.' || $dir == '..') { $dir = ''; } - $port = ''; - if ($_SERVER["SERVER_PORT"] != "80") { + $scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http'; + if ((($scheme == 'http') && ($_SERVER["SERVER_PORT"] == "80")) || + (($scheme == 'https') && ($_SERVER["SERVER_PORT"] == "443"))) { + $port = ''; + } else { $port = ':' . $_SERVER["SERVER_PORT"]; } - $scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http'; if ($dir === '') { $this->siteUrl = $scheme . '://' . trim($_SERVER['SERVER_NAME'], "/") . $port . "/"; return;