]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17802 fixed wwwroot without any subdirectory issue
authorskodak <skodak>
Wed, 7 Jan 2009 09:54:09 +0000 (09:54 +0000)
committerskodak <skodak>
Wed, 7 Jan 2009 09:54:09 +0000 (09:54 +0000)
lib/setuplib.php

index 0fb0348422eb197c9342d2a01518a156e8c21925..1d8ca93acb62e4052e7fa0906a545abb04b2562d 100644 (file)
@@ -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;