MDL-18059 database rates - secured
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user