Commit e6383621 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Add the correct amount of slashes if the application is installed at the

document root.
parent 29ca4f80
......@@ -56,7 +56,11 @@ foreach (array('docroot', 'dataroot') as $path) {
if (!isset($CFG->wwwroot)) {
$proto = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
$CFG->wwwroot = $proto . $host . '/' . substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])). '/';
$path = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT']));
if ($path) {
$path .= '/';
}
$CFG->wwwroot = $proto . $host . '/' . $path;
}
// core libraries
......
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