Browse Source

check var exists before using

MOODLE_26_STABLE
Dan Marsden 12 years ago
parent
commit
c0e9455017
  1. 2
      sessions.php

2
sessions.php

@ -208,7 +208,7 @@ function construct_sessions_data_for_add($formdata) {
while ($sdate < $enddate) { while ($sdate < $enddate) {
if ($sdate < $startweek + WEEKSECS) { if ($sdate < $startweek + WEEKSECS) {
$dinfo = usergetdate($sdate); $dinfo = usergetdate($sdate);
if (array_key_exists($wdaydesc[$dinfo['wday']], $formdata->sdays)) { if (isset($formdata->sdays) && array_key_exists($wdaydesc[$dinfo['wday']], $formdata->sdays)) {
$sess = new stdClass(); $sess = new stdClass();
$sess->sessdate = usergetmidnight($sdate) + $starttime; $sess->sessdate = usergetmidnight($sdate) + $starttime;
$sess->duration = $duration; $sess->duration = $duration;

Loading…
Cancel
Save