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
+1
View File
@@ -131,6 +131,7 @@ $string['importsuccess'] = 'The preset has been successfully applied.';
$string['insufficiententries'] = 'more entries needed to view this database';
$string['intro'] = 'Introduction';
$string['invalidfieldname'] = 'Please choose another name for this field';
$string['invalidrate'] = 'Invalid database rate ($a)';
$string['invalidurl'] = 'The URL you just entered is not valid';
$string['jstemplate'] = 'Javascript template';
$string['latitude'] = 'Latitude';
+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++;