Skip to content
Permalink
Browse files

Fixed install issue preventing the right check on directories creation

  • Loading branch information...
ywarnier committed Oct 7, 2013
1 parent d9ea110 commit 2e7a124ab650f41ff0e2124398c47c911e40147b
Showing with 6 additions and 6 deletions.
  1. +6 −6 main/install/install.lib.php
@@ -2162,19 +2162,19 @@ function check_course_script_interpretation($course_dir, $course_attempt_name, $
$content = '<?php echo "123"; exit;';
if (is_writable($file_name)) {
if ($handler = @fopen($file_name, "w")) {
//write content
if (fwrite($handler , $content)) {
if ($handler = @fopen($file_name, "w")) {
//write content
if (fwrite($handler, $content)) {
$sock_errno = ''; $sock_errmsg = '';
$url = api_get_path(WEB_COURSE_PATH).'/'.$course_attempt_name.'/'.$file;
$url = api_get_path(WEB_COURSE_PATH).$course_attempt_name.'/'.$file;
$parsed_url = parse_url($url);
//$scheme = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] : ''; //http
$host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
$path = isset($parsed_url['path']) ? $parsed_url['path'] : '/';
$port = isset($parsed_url['port']) ? $parsed_url['port'] : '80';
//Check fsockopen
//Check fsockopen (doesn't work with https)
if ($fp = @fsockopen(str_replace('http://', '', $url), -1, $sock_errno, $sock_errmsg, 60)) {
$out = "GET $path HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
@@ -2217,4 +2217,4 @@ function check_course_script_interpretation($course_dir, $course_attempt_name, $
}
return $output;
}
}

0 comments on commit 2e7a124

Please sign in to comment.
You can’t perform that action at this time.