From 2192e94ef2aa7baecad1cd713ca45e0482609457 Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 1 Jul 2008 23:01:01 +0000 Subject: [PATCH] MDL-10633 fixed regression in last commit --- calendar/event.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/calendar/event.php b/calendar/event.php index 733fcc2484d..03a377bd647 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -97,6 +97,8 @@ } } + $form = null; + switch($action) { case 'delete': $title = get_string('deleteevent', 'calendar'); @@ -125,10 +127,6 @@ $form->name = clean_param(strip_tags($form->name,''), 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; @@ -157,25 +155,23 @@ } 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&id='.$form->id, $form->name); + add_to_log($form->courseid, 'calendar', 'edit all', 'event.php?action=edit&id='.$form->id, stripslashes($form->name)); } else { // Update this $form->timemodified = time(); 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&id='.$form->id, $form->name); + add_to_log($form->courseid, 'calendar', 'edit', 'event.php?action=edit&id='.$form->id, stripslashes($form->name)); } // OK, now redirect to day view @@ -260,6 +256,8 @@ break; } + $form = stripslashes_recursive($form); + // Let's see if we are supposed to provide a referring course link // but NOT for the "main page" course if($SESSION->cal_course_referer != SITEID &&