From: danmarsden Date: Wed, 12 Apr 2006 21:15:10 +0000 (+0000) Subject: need to check vars aren't empty b4 using them! - another one! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=22d56e80151835442afba7e63e02bcf912e41db1;p=moodle.git need to check vars aren't empty b4 using them! - another one! --- diff --git a/mod/choice/lib.php b/mod/choice/lib.php index 9351d1abb1..9264e09049 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -74,7 +74,9 @@ function choice_add_instance($choice) { $option = NULL; $option->text = $value; $option->choiceid = $choice->id; - $option->maxanswers = $choice->{'newlimit'.substr($name, 9)}; + if (isset($choice->{'newlimit'.substr($name, 9)})) { + $option->maxanswers = $choice->{'newlimit'.substr($name, 9)}; + } $option->timemodified = time(); insert_record("choice_options", $option); }