From: skodak Date: Tue, 22 Aug 2006 22:19:58 +0000 (+0000) Subject: debug off level is now 5 instead of 7 to prevent E_WARNING on production sites SC#294 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2881101ca16363a80096e87526ad5fe627d06e40;p=moodle.git debug off level is now 5 instead of 7 to prevent E_WARNING on production sites SC#294 --- diff --git a/install.php b/install.php index 67dbab7131..ef436f9c8c 100644 --- a/install.php +++ b/install.php @@ -141,10 +141,19 @@ $INSTALL['release'] = $release; /// Have the $db object ready because we are going to use it often $db = &ADONewConnection($INSTALL['dbtype']); -/// guess the www root +/// guess the www root and secure dataroot if ($INSTALL['wwwroot'] == '') { list($INSTALL['wwwroot'], $xtra) = explode('/install.php', qualified_me()); $INSTALL['wwwrootform'] = $INSTALL['wwwroot']; + + // now count slashes and treverse dirroot to get one level above web root + $up = preg_match_all('/\//', $INSTALL['wwwroot'], $matches) - 1; + $CFG->dataroot = $CFG->dirroot; + for ($i=0; $i<$up; $i++) { + $CFG->dataroot = dirname($CFG->dataroot); + } + $CFG->dataroot .= '/moodledata'; + $INSTALL['dataroot'] = $CFG->dataroot; } $headstagetext = array(WELCOME => get_string('chooselanguagehead', 'install'),