Skip to content

Commit

Permalink
MDL-10633 fixed regression in last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 1, 2008
1 parent 0457fe8 commit b3b6a4f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions calendar/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
}
}

$form = null;

switch($action) {
case 'delete':
$title = get_string('deleteevent', 'calendar');
Expand Down Expand Up @@ -130,10 +132,6 @@

$form->name = clean_param(strip_tags($form->name,'<lang><span>'), PARAM_CLEAN);

// To avoid double slashes
$form->name = stripslashes($form->name);
$form->description = stripslashes($form->description);

$form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin);
if($form->duration == 1) {
$form->timeduration = make_timestamp($form->endyr, $form->endmon, $form->endday, $form->endhr, $form->endmin) - $form->timestart;
Expand Down Expand Up @@ -162,15 +160,14 @@
}

execute_sql('UPDATE '.$CFG->prefix.'event SET '.
'name = '.$db->qstr($form->name).','.
'description = '.$db->qstr($form->description).','.
'name = \''.$form->name.'\','.
'description = \''.$form->description.'\','.
'timestart = '.$timestartoffset.','.
'timeduration = '.$form->timeduration.','.
'timemodified = '.time().' WHERE repeatid = '.$event->repeatid);

/// Log the event update.
$form->name = stripslashes($form->name); //To avoid double-slashes
add_to_log($form->courseid, 'calendar', 'edit all', 'event.php?action=edit&amp;id='.$form->id, $form->name);
add_to_log($form->courseid, 'calendar', 'edit all', 'event.php?action=edit&amp;id='.$form->id, stripslashes($form->name));
}

else {
Expand All @@ -179,8 +176,7 @@
update_record('event', $form);

/// Log the event update.
$form->name = stripslashes($form->name); //To avoid double-slashes
add_to_log($form->courseid, 'calendar', 'edit', 'event.php?action=edit&amp;id='.$form->id, $form->name);
add_to_log($form->courseid, 'calendar', 'edit', 'event.php?action=edit&amp;id='.$form->id, stripslashes($form->name));
}

// OK, now redirect to day view
Expand Down Expand Up @@ -265,6 +261,7 @@
break;
}

$form = stripslashes_recursive($form);

if (!empty($SESSION->cal_course_referer)) {
// TODO: This is part of the Great $course Hack in Moodle. Replace it at some point.
Expand Down

0 comments on commit b3b6a4f

Please sign in to comment.