Commit 08bd1bfe authored by Francois Marier's avatar Francois Marier
Browse files

Fix wwwroot generation when DOCUMENT_ROOT is missing



Bug #783282

Change-Id: I45b5116d74298fba213fcdd4a9d993a4d0650917
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent fbc45f73
......@@ -166,7 +166,10 @@ if (!isset($CFG->wwwroot) && isset($_SERVER['HTTP_HOST'])) {
list($host) = explode(',', $host);
$host = trim($host);
}
$path = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT']));
$path = '';
if (strpos(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])) === 0) {
$path = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT']));
}
if ($path) {
$path = str_replace('\\', '/', $path); // windows
if (substr($path, 0, 1) != '/') {
......
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