mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 00:53:00 +01:00
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:
@@ -286,8 +286,9 @@ if (!$found) {
|
||||
// There is no subdir that compose the main url root or autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT).
|
||||
$tmp = $dolibarr_main_url_root;
|
||||
} else {
|
||||
$tmp = 'http'.(((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') && (empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] != 443)) ? '' : 's').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == 80 || $_SERVER["SERVER_PORT"] == 443) ? '' : ':'.$_SERVER["SERVER_PORT"]).($tmp3 ? (preg_match('/^\//', $tmp3) ? '' : '/').$tmp3 : '');
|
||||
$tmp = 'http'.((!isHTTPS() && (empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] != 443)) ? '' : 's').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == 80 || $_SERVER["SERVER_PORT"] == 443) ? '' : ':'.$_SERVER["SERVER_PORT"]).($tmp3 ? (preg_match('/^\//', $tmp3) ? '' : '/').$tmp3 : '');
|
||||
}
|
||||
|
||||
//print "tmp1=".$tmp1." tmp2=".$tmp2." tmp3=".$tmp3." tmp=".$tmp."\n";
|
||||
if (!empty($dolibarr_main_force_https)) {
|
||||
$tmp = preg_replace('/^http:/i', 'https:', $tmp);
|
||||
|
||||
Reference in New Issue
Block a user