From 9b95c52a3d1e8c1190932422c6f0f3c39a32a1c6 Mon Sep 17 00:00:00 2001 From: prasad <prasad@vtiger.com> Date: Wed, 28 Oct 2015 01:45:24 +0530 Subject: [PATCH] Fixed site_URL check with subdomain/path. (REQUEST_SCHEME was not reliable used HTTPS instead). --- includes/main/WebUI.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/main/WebUI.php b/includes/main/WebUI.php index 4b6dde122..16d55b722 100644 --- a/includes/main/WebUI.php +++ b/includes/main/WebUI.php @@ -105,8 +105,9 @@ class Vtiger_WebUI extends Vtiger_EntryPoint { vglobal('current_user', $currentUser); // Check we are being connected to on the right host and protocol - global $site_URL; - if ($site_URL && (stripos($site_URL,$_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_HOST']) !== 0)){ + global $site_URL; + $request_URL = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on')? 'https': 'http')."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; + if ($site_URL && stripos($request_URL, $site_URL) !== 0){ header("Location: $site_URL",TRUE,301); exit; } -- GitLab