Commit 577019db authored by Darryl Hamilton's avatar Darryl Hamilton
Browse files

Add trailing slash autocorrection for wwwroot (bug #745426)



Change-Id: I9c04ac01f65c983a54015e370fd592b8a4bfc147
Signed-off-by: default avatarDarryl Hamilton <darrylh@catalyst.net.nz>
parent e7c44a14
......@@ -55,12 +55,14 @@ $cfg->dbprefix = '';
// wwwroot - the web-visible path to your Mahara installation
// Normally, this is automatically detected - if it doesn't work for you
// then try specifying it here
// This value must end with a /
//$cfg->wwwroot = 'http://myhost.com/mahara/';
// You will only need to specify this if you want to use HTTPS for
// logins, but not for regular pages. If you want to serve all of your
// Mahara content via HTTPS, just set $cfg->wwwroot to use HTTPS instead.
//$cfg->httpswwwroot = 'https://myhost.com/mahara';
// This value must end with a /
//$cfg->httpswwwroot = 'https://myhost.com/mahara/';
// dataroot - uploaded files are stored here
// This is a ABSOLUTE FILESYSTEM PATH. This is NOT a URL.
......
......@@ -185,6 +185,11 @@ if (!isset($CFG->wwwroot) && isset($_SERVER['HTTP_HOST'])) {
$CFG->wwwroot = $wwwroot;
}
}
if (isset($CFG->wwwroot)) {
if (substr($CFG->wwwroot, -1, 1) != '/') {
$CFG->wwwroot .= '/';
}
}
if (isset($CFG->httpswwwroot)) {
if (substr($CFG->httpswwwroot, -1, 1) != '/') {
$CFG->httpswwwroot .= '/';
......
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