Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-26277 grade import: validate file pointer before reading

  • Loading branch information...
commit e8a2fa86aa8e7c98689f4c849b5f2cc20b260e51 1 parent 6791b08
@mackensen mackensen authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 grade/import/csv/index.php
View
4 grade/import/csv/index.php
@@ -126,7 +126,9 @@
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));
Please sign in to comment.
Something went wrong with that request. Please try again.