Commit b2f8451c authored by Donal McMullan's avatar Donal McMullan

Fix for bogus URL generation when Mahara's in a subdir - it chooses http://example.com//mahara

parent 805c82a9
......@@ -129,9 +129,12 @@ if (!isset($CFG->wwwroot) && isset($_SERVER['HTTP_HOST'])) {
}
$path = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT']));
if ($path) {
if (substr($path, 0, 1) != '/') {
$path = '/' . $path;
}
$path .= '/';
}
$wwwroot = $proto . $host . '/' . $path;
$wwwroot = $proto . $host . $path;
try {
set_config('wwwroot', $wwwroot);
}
......
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