Commit 6ce67cd7 authored by Dan Marsden's avatar Dan Marsden
Browse files

fix detection of https (Bug #587823)


Signed-off-by: default avatarDan Marsden <dan@catalyst.net.nz>
parent 282d7e11
......@@ -29,7 +29,6 @@ defined('INTERNAL') || die();
$CFG = new StdClass;
$CFG->docroot = dirname(__FILE__) . '/';
//array containing site options from database that are overrided by $CFG
$OVERRIDDEN = array();
......@@ -161,7 +160,7 @@ catch (SQLException $e) {
// Make sure wwwroot is set and available, either in the database or in the
// config file. Cron requires it for some purposes.
if (!isset($CFG->wwwroot) && isset($_SERVER['HTTP_HOST'])) {
$proto = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';
$proto = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') ? 'https://' : 'http://';
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
if (false !== strpos($host, ',')) {
list($host) = explode(',', $host);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment