MDL-18059 database rates - secured

This commit is contained in:
stronk7
2009-05-06 10:16:54 +00:00
parent 696018df63
commit 8d73532067
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -33,6 +33,9 @@
error("This page was not accessed correctly");
}
/// Calculate scale values
$scale_values = make_grades_menu($data->scale);
$count = 0;
foreach ((array)$frmdata as $recordid => $rating) {
@@ -52,6 +55,11 @@
continue;
}
/// Check rate is valid for that database scale values
if (!array_key_exists($rating, $scale_values) && $rating != -999) {
print_error('invalidrate', 'data', '', $rating);
}
// input validation ok
$count++;