From 37ccf1fec919957cea1aa7c725dab92bb3c16e90 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 7 Jan 2009 09:54:09 +0000 Subject: [PATCH] MDL-17802 fixed wwwroot without any subdirectory issue --- lib/setuplib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.39.5