]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19121 Not allowing negative values for droplow and keephigh: capping at 0. Merged...
authornicolasconnault <nicolasconnault>
Fri, 8 May 2009 13:31:30 +0000 (13:31 +0000)
committernicolasconnault <nicolasconnault>
Fri, 8 May 2009 13:31:30 +0000 (13:31 +0000)
grade/edit/tree/index.php

index c4dbd53f47e46147d8fc61b8d8f69f65780d5983..6ec894b6f0e22073ac7925f68f4d613f3729a388 100644 (file)
@@ -233,6 +233,10 @@ if ($form_key && $data = data_submitted()) {
         // Grade category text inputs
         if (preg_match('/(aggregation|droplow|keephigh)_([0-9]*)/', $key, $matches) && confirm_sesskey()) {
             $value = required_param($matches[0], PARAM_INT);
+
+            // Do not allow negative values
+            $value = ($value < 0) ? 0 : $value;
+
             $param = $matches[1];
             $a->id = $matches[2];