diff --git a/grade/import/csv/index.php b/grade/import/csv/index.php index 11ae292f7c4..de9abe2e3ca 100644 --- a/grade/import/csv/index.php +++ b/grade/import/csv/index.php @@ -125,7 +125,9 @@ if ($formdata = $mform->get_data()) { fwrite($fp,$text); fclose($fp); - $fp = fopen($filename, "r"); + if (!$fp = fopen($filename, "r")) { + print_error('cannotopenfile'); + } // --- get header (field names) --- $header = explode($csv_delimiter, fgets($fp, GRADE_CSV_LINE_LENGTH));