From: paca70 Date: Fri, 22 Oct 2004 10:15:56 +0000 (+0000) Subject: Check if url-based fopen() is enebled before trying to use it. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2df3a7219de9b7542679f3e2371e203fb3a17e57;p=moodle.git Check if url-based fopen() is enebled before trying to use it. --- diff --git a/install.php b/install.php index 9fea71ddbd..4916f1ae47 100644 --- a/install.php +++ b/install.php @@ -162,26 +162,26 @@ if ($INSTALL['stage'] == 2) { if (($fh = @fopen($INSTALL['dirroot'].'/install.php', 'r')) === false ) { $CFG->dirroot = dirname(__FILE__); $INSTALL['dirroot'] = dirname(__FILE__); - $errormsg = get_string('dirrooterror', 'install'); - } else { - fclose($fh); + $errormsg .= get_string('dirrooterror', 'install').'
'; + } + if ($fh) fclose($fh); - $CFG->dirroot = $INSTALL['dirroot']; + $CFG->dirroot = $INSTALL['dirroot']; - /// check wwwroot + /// check wwwroot + if (ini_get('allow_url_fopen')) { if (($fh = @fopen($INSTALL['wwwroot'].'/install.php', 'r')) === false) { - $errormsg = get_string('wwwrooterror', 'install'); - } else { - fclose($fh); - - /// check dataroot - $CFG->dataroot = $INSTALL['dataroot']; - if (make_upload_directory('sessions', false) === false ) { - $errormsg = get_string('datarooterror', 'install'); - } + $errormsg .= get_string('wwwrooterror', 'install').'
'; } } - + if ($fh) fclose($fh); + + /// check dataroot + $CFG->dataroot = $INSTALL['dataroot']; + if (make_upload_directory('sessions', false) === false ) { + $errormsg = get_string('datarooterror', 'install').'
'; + } + if ($fh) fclose($fh); if (!empty($errormsg)) $nextstage = 2; @@ -555,7 +555,7 @@ function form_table($nextstage = 0, $formaction = "install.php") {

- +