From 09d36284d1f8ade220701330250ffaf8b8e2d4c1 Mon Sep 17 00:00:00 2001 From: defacer Date: Thu, 26 Aug 2004 10:52:00 +0000 Subject: [PATCH] Importing fixes from MOODLE_14_STABLE --- calendar/event.php | 4 ++-- calendar/lib.php | 16 +++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/calendar/event.php b/calendar/event.php index 1b44b1da76..ec1af92eed 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -112,7 +112,7 @@ if($form = data_submitted()) { $form->name = strip_tags($form->name); // Strip all tags - $form->description = clean_text($form->description , $form->format); // Clean up any bad tags + //$form->description = clean_text($form->description , $form->format); // Clean up any bad tags $form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin); if($form->duration == 1) { @@ -152,7 +152,7 @@ if(!empty($form) && $form->type == 'defined') { $form->name = strip_tags($form->name); // Strip all tags - $form->description = clean_text($form->description , $form->format); // Clean up any bad tags + //$form->description = clean_text($form->description , $form->format); // Clean up any bad tags $form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin); if($form->duration == 1) { diff --git a/calendar/lib.php b/calendar/lib.php index 95fbbf6044..4701fecf68 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -410,10 +410,7 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura } else if($users === false) { // No user at all - if(!empty($whereclause)) { - $whereclause .= ' OR'; - } - $whereclause .= ' 0'; + // No need to do anything } if(is_array($groups) && !empty($groups)) { // Events from a number of groups @@ -440,10 +437,7 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura } else { // This means NO courses, not that we don't care! - if(!empty($whereclause)) { - $whereclause .= ' OR'; - } - $whereclause .= ' 0'; + // No need to do anything } } else if(is_numeric($courses)) { @@ -477,7 +471,7 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura $whereclause = $timeclause; } - return $whereclause; + return empty($whereclause) ? false : $whereclause; } function calendar_top_controls($type, $data) { @@ -1169,10 +1163,10 @@ function calendar_format_event_time($event, $now, $morehref, $usecommonwords = t // Set printable representation $eventtime = calendar_get_link_tag($day, CALENDAR_URL.'view.php?view=day'.$morehref.'&', $startdate['mday'], $startdate['mon'], $startdate['year']).' ('.$time.')'; } - + return $eventtime; } - + if(!function_exists('array_diff_assoc')) { // PHP < 4.3.0 function array_diff_assoc($source, $diff) { -- 2.39.5