|
|
|
@ -2162,11 +2162,11 @@ 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 |
|
|
|
@ -2174,7 +2174,7 @@ function check_course_script_interpretation($course_dir, $course_attempt_name, $ |
|
|
|
|
$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"; |
|
|
|
|