mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-26277 grade import: validate file pointer before reading
This commit is contained in:
parent
e16e2300c5
commit
280b223d84
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user