Browse files

MDL-10633 fixed regression in last commit

  • Loading branch information...
1 parent 0457fe8 commit b3b6a4fff730bb22e3b401d4bd3ea9afb82141c8 skodak committed Jul 1, 2008
Showing with 7 additions and 10 deletions.
  1. +7 −10 calendar/event.php
View
17 calendar/event.php
@@ -102,6 +102,8 @@
}
}
+ $form = null;
+
switch($action) {
case 'delete':
$title = get_string('deleteevent', 'calendar');
@@ -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;
@@ -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 {
@@ -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
@@ -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.

0 comments on commit b3b6a4f

Please sign in to comment.