From: skodak Date: Wed, 7 Jan 2009 09:54:09 +0000 (+0000) Subject: MDL-17802 fixed wwwroot without any subdirectory issue X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=37ccf1fec919957cea1aa7c725dab92bb3c16e90;p=moodle.git MDL-17802 fixed wwwroot without any subdirectory issue --- diff --git a/lib/setuplib.php b/lib/setuplib.php index 0fb0348422..1d8ca93acb 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -92,6 +92,10 @@ function initialise_fullme() { global $CFG, $FULLME, $ME, $SCRIPT, $FULLSCRIPT; $url = parse_url($CFG->wwwroot); + if (!isset($url['path'])) { + $url['path'] = ''; + } + $url['path'] .= '/'; if (CLI_SCRIPT) { // urls do not make much sense in CLI scripts @@ -146,7 +150,7 @@ function initialise_fullme() { } if (strpos($rurl['path'], $url['path']) === 0) { - $SCRIPT = substr($rurl['path'], strlen($url['path'])); + $SCRIPT = substr($rurl['path'], strlen($url['path'])-1); } else { // probably some weird external script $SCRIPT = $FULLSCRIPT = $FULLME = $ME = null;