2
0
forked from Wavyzz/dolibarr

FIX Https detection

theme/eldy/manifest.json.php was returning http:// links instead of the
https link defined in the configuration.
I found that this is because I am behide a proxy and that isHTTPS does
the detection as expected.

Therefore that function is used to detect https which results in the correct
urls.

Detected on my 18.0.2 installation
This commit is contained in:
MDW
2024-01-26 02:22:23 +01:00
parent b05d1c5f6e
commit 3c2bc3a842
2 changed files with 3 additions and 2 deletions

View File

@@ -432,7 +432,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) && (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') && !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