From: nicolasconnault Date: Fri, 8 May 2009 13:31:30 +0000 (+0000) Subject: MDL-19121 Not allowing negative values for droplow and keephigh: capping at 0. Merged... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b31f8d294d295d0d6c873718996047cbd67a81ad;p=moodle.git MDL-19121 Not allowing negative values for droplow and keephigh: capping at 0. Merged from MOODLE_19_STABLE --- diff --git a/grade/edit/tree/index.php b/grade/edit/tree/index.php index c4dbd53f47..6ec894b6f0 100644 --- a/grade/edit/tree/index.php +++ b/grade/edit/tree/index.php @@ -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];