FIX: force https: infinite redirection in case the access is already secure

This commit is contained in:
Marc de Lima Lucio 2024-01-30 22:16:38 +01:00
parent ebf5fd261b
commit 0d2d607c48

View File

@ -466,7 +466,7 @@ if (GETPOST('textbrowser', 'int') || (!empty($conf->browser->name) && $conf->bro
// Force HTTPS if required ($conf->file->main_force_https is 0/1 or 'https dolibarr root url')
// $_SERVER["HTTPS"] is 'on' when link is https, otherwise $_SERVER["HTTPS"] is empty or 'off'
if (!empty($conf->file->main_force_https) && isHTTPS() && !defined('NOHTTPSREDIRECT')) {
if (!empty($conf->file->main_force_https) && !isHTTPS() && !defined('NOHTTPSREDIRECT')) {
$newurl = '';
if (is_numeric($conf->file->main_force_https)) {
if ($conf->file->main_force_https == '1' && !empty($_SERVER["SCRIPT_URI"])) { // If SCRIPT_URI supported by server