Commit 02cf299a authored by Ruslan Kabalin's avatar Ruslan Kabalin Committed by Richard Mansfield
Browse files

Ensure that secure connection is being used when wwwroot is set to ^https


Signed-off-by: default avatarRuslan Kabalin <ruslan.kabalin@luns.net.uk>
parent 903e9a8b
......@@ -190,6 +190,11 @@ if (isset($CFG->wwwroot)) {
$CFG->wwwroot .= '/';
}
}
// Make sure that we are using ssl if wwwroot expects us to do so
if ((!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') &&
parse_url($CFG->wwwroot, PHP_URL_SCHEME) === 'https'){
redirect(get_relative_script_path());
}
if (!isset($CFG->noreplyaddress) && isset($_SERVER['HTTP_HOST'])) {
$noreplyaddress = 'noreply@';
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_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