From: skodak Date: Wed, 13 Dec 2006 09:53:59 +0000 (+0000) Subject: MDL-5696 fixed 'Checkbox' actually allows 'checkboxes' and empty 'options' (radio... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6c31d376c2e4d7115f1455d6dfdff09d6c8cdc6d;p=moodle.git MDL-5696 fixed 'Checkbox' actually allows 'checkboxes' and empty 'options' (radio buttons too) --- diff --git a/mod/data/field/checkbox/field.class.php b/mod/data/field/checkbox/field.class.php index a5912ac408..93aa699efc 100755 --- a/mod/data/field/checkbox/field.class.php +++ b/mod/data/field/checkbox/field.class.php @@ -46,6 +46,9 @@ class data_field_checkbox extends data_field_base { $i = 0; foreach (explode("\n", $this->field->param1) as $checkbox) { $checkbox = trim($checkbox); + if ($checkbox === '') { + continue; // skip empty lines + } $str .= 'field->param1) as $radio) { $radio = trim($radio); + if ($radio === '') { + continue; // skip empty lines + } $str .= '