From 9b00469b471a8b159c60ecca333f0f7064ba1d27 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Sat, 20 Dec 2008 03:22:54 +0000 Subject: misc error warnings and notices --- functions/draw_functions.php | 8 +++---- functions/ical_parser.php | 20 ++++++++++++----- functions/init/date_range.php | 2 +- functions/parse/end_vevent.php | 5 +++-- functions/parse/recur_functions.php | 2 +- functions/template.php | 37 +++++++++++++++++------------- includes/event.php | 23 ++++++++++--------- includes/todo.php | 10 ++++----- month.php | 2 +- print.php | 22 +++++++++--------- rss/index.php | 45 ++++++++++++++++++------------------- rss/rss.php | 2 +- rss/rss1.0.php | 6 ++--- rss/rss2.0.php | 6 ++--- rss/rss_common.php | 6 ++--- week.php | 2 +- year.php | 12 +++++----- 17 files changed, 115 insertions(+), 95 deletions(-) diff --git a/functions/draw_functions.php b/functions/draw_functions.php index 20938a9..cc1c363 100644 --- a/functions/draw_functions.php +++ b/functions/draw_functions.php @@ -5,8 +5,8 @@ function drawEventTimes ($start, $end) { global $phpiCal_config; $gridLength = $phpiCal_config->gridLength; preg_match ('/([0-9]{2})([0-9]{2})/', $start, $time); - $sta_h = $time[1]; - $sta_min = $time[2]; + $sta_h = @$time[1]; + $sta_min = @$time[2]; $sta_min = sprintf("%02d", floor($sta_min / $gridLength) * $gridLength); if ($sta_min == 60) { $sta_h = sprintf("%02d", ($sta_h + 1)); @@ -14,8 +14,8 @@ function drawEventTimes ($start, $end) { } preg_match ('/([0-9]{2})([0-9]{2})/', $end, $time); - $end_h = $time[1]; - $end_min = $time[2]; + $end_h = @$time[1]; + $end_min = @$time[2]; $end_min = sprintf("%02d", floor($end_min / $gridLength) * $gridLength); if ($end_min == 60) { $end_h = sprintf("%02d", ($end_h + 1)); diff --git a/functions/ical_parser.php b/functions/ical_parser.php index c52594d..393a076 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -135,7 +135,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { $allday_start, $allday_end, $start, $end, $the_duration, $beginning, $start_of_vevent, $url, $valarm_description, $start_unixtime, $end_unixtime, $display_end_tmp, $end_time_tmp1, - $recurrence_id, $uid, $rrule, $abs_until, $until_check, + $recurrence_id, $uid, $rrule, $until_check, $until, $byweek, $byweekno, $byminute, $byhour, $bysecond ); @@ -170,9 +170,9 @@ foreach ($cal_filelist as $cal_key=>$filename) { include BASE."functions/parse/end_vevent.php"; break; case 'END:VTODO': - if ((!$vtodo_priority) && ($status == 'COMPLETED')) { + if (($vtodo_priority == '') && ($status == 'COMPLETED')) { $vtodo_sort = 11; - } elseif (!$vtodo_priority) { + } elseif ($vtodo_priority == '') { $vtodo_sort = 10; } else { $vtodo_sort = $vtodo_priority; @@ -209,6 +209,16 @@ foreach ($cal_filelist as $cal_key=>$filename) { case 'BEGIN:VTODO': $vtodo_set = TRUE; + $summary = ''; + $due_date = ''; + $due_time = ''; + $completed_date = ''; + $completed_time = ''; + $vtodo_priority = ''; + $vtodo_categories = ''; + $status = ''; + $class = ''; + $description = ''; break; case 'BEGIN:VALARM': $valarm_set = TRUE; @@ -287,7 +297,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { preg_match ('/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2})([0-9]{0,2})/', $exdata, $regs); $except_dates[] = $regs[1] . $regs[2] . $regs[3]; // Added for Evolution, since they dont think they need to tell me which time to exclude. - if (($regs[4] == '') && ($start_time != '')) { + if ($regs[4] == '' && isset($start_time) && $start_time != '') { $except_times[] = $start_time; } else { $except_times[] = $regs[4] . $regs[5]; @@ -356,7 +366,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { } else { $offset_tmp = $chooseOffset($recur_unixtime); } - $recur_unixtime = calcTime($offset_tmp, $server_offset_tmp, $recur_unixtime); + $recur_unixtime = calcTime($offset_tmp, @$server_offset_tmp, $recur_unixtime); $recurrence_id['date'] = date('Ymd', $recur_unixtime); $recurrence_id['time'] = date('Hi', $recur_unixtime); $recurrence_d = date('Ymd', $recur_unixtime); diff --git a/functions/init/date_range.php b/functions/init/date_range.php index d7e4235..c74b1dc 100644 --- a/functions/init/date_range.php +++ b/functions/init/date_range.php @@ -3,7 +3,7 @@ if (!isset($getdate)) { if (isset($_GET['getdate']) && ($_GET['getdate'] !== '')) { $getdate = $_GET['getdate']; } else { - $getdate = date('Ymd', time() + $phpIcal_config->second_offset); + $getdate = date('Ymd', time() + $phpiCal_config->second_offset); } } diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php index 88f94fa..e9e3064 100644 --- a/functions/parse/end_vevent.php +++ b/functions/parse/end_vevent.php @@ -11,6 +11,8 @@ What happens in this file: 3. Add occurrences to master_array */ +if (!isset($start_date)) echo "no start date for $summary
"; + // Handle DURATION if (!isset($end_unixtime)) { if(!isset($the_duration)) $the_duration = 0; @@ -132,7 +134,6 @@ foreach ($rrule_array as $key => $val) { $until = str_replace('T', '', $val); $until = str_replace('Z', '', $until); if (strlen($until) == 8) $until = $until.'235959'; - $abs_until = $until; ereg ('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})', $until, $regs); $until_unixtime = mktime($regs[4],$regs[5],@$regs[6],$regs[2],$regs[3],$regs[1]); $recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = localizeDate($dateFormat_week,$until); @@ -330,7 +331,7 @@ foreach($recur_data as $recur_data_unixtime) { // Let's double check the until to not write past it $until_check = $start_date_tmp.$time_tmp.'00'; - if ($abs_until > $until_check) { + if (@$until > $until_check) { $master_array[$start_date_tmp][$time_tmp][$uid] = array ( 'event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, diff --git a/functions/parse/recur_functions.php b/functions/parse/recur_functions.php index daf7399..c0ea88f 100644 --- a/functions/parse/recur_functions.php +++ b/functions/parse/recur_functions.php @@ -57,7 +57,7 @@ function add_recur($times,$freq=''){ } function expand_bymonth($time){ global $bymonth, $byweekno, $bymonthday, $year, $start_unixtime, $freq_type; - if(!empty($byweekno)) return $times; + if(!empty($byweekno)) return $time; if(empty($bymonth)) $bymonth = array(date("m", $start_unixtime)); $d = date("d",$start_unixtime); if (!empty($bymonthday)) $d = 1; diff --git a/functions/template.php b/functions/template.php index ed73672..5338b44 100644 --- a/functions/template.php +++ b/functions/template.php @@ -64,32 +64,34 @@ class Page { $parse_year = date ("Y", strtotime($getdate)); $seen_events = array(); + $final = ''; foreach($master_array as $key => $val) { preg_match ('/([0-9]{6})([0-9]{2})/', $key, $regs); - if ((($regs[1] == $parse_month) && ($printview == 'month')) || (($key == $getdate) && ($printview == 'day')) || ((($key >= $week_start) && ($key <= $week_end)) && ($printview == 'week')) || ((substr($regs[1],0,4) == $parse_year) && ($printview == 'year'))) { - $events_week++; + if (((@$regs[1] == $parse_month) && ($printview == 'month')) || (($key == $getdate) && ($printview == 'day')) || ((($key >= $week_start) && ($key <= $week_end)) && ($printview == 'week')) || ((substr(@$regs[1],0,4) == $parse_year) && ($printview == 'year'))) { + @$events_week++; $dayofmonth = strtotime ($key); $dayofmonth = localizeDate ($dateFormat_day, $dayofmonth); $events_tmp = $loop_event; $day_tmp = $loop_day; $day_events = 0; // Pull out each day + $some_events = ''; foreach ($val as $new_val) { foreach ($new_val as $new_key2 => $new_val2) { - if (isset($seen_events["$new_key2"]) && $new_val2['spans_day'] == 1){ + if (isset($seen_events["$new_key2"]) && isset($new_val2['spans_day']) && $new_val2['spans_day'] == 1){ $new_val2['event_text'] .= " second instance of ".$new_key2; continue; } $seen_events["$new_key2"] = 1; $day_events++; - if ($new_val2['event_text']) { + if (isset($new_val2['event_text'])) { $event_text = stripslashes(urldecode($new_val2['event_text'])); - $location = stripslashes(urldecode($new_val2['location'])); - $description = stripslashes(urldecode($new_val2['description'])); - $event_start = $new_val2['event_start']; - $event_end = $new_val2['event_end']; + $location = stripslashes(urldecode(@$new_val2['location'])); + $description = stripslashes(urldecode(@$new_val2['description'])); + $event_start = @$new_val2['event_start']; + $event_end = @$new_val2['event_end']; if (isset($new_val2['display_end'])) $event_end = $new_val2['display_end']; - if (!$new_val2['event_start']) { + if (!isset($new_val2['event_start'])) { $event_start = $lang['l_all_day']; $event_start2 = ''; $event_end = ''; @@ -119,7 +121,8 @@ class Page { if ($day_events == 0) continue; $day_tmp = str_replace('{DAYOFMONTH}', $dayofmonth, $day_tmp); $final .= $day_tmp.$some_events; - unset ($day_tmp, $some_events); + unset ($day_tmp); + $some_events = ''; } } @@ -279,11 +282,12 @@ class Page { $loop_ad = trim($match1[1]); $loop_begin = trim($match2[1]); $loop_end = trim($match3[1]); + $weekreplace = ''; foreach ($weekarray as $get_date) { $replace = $loop_begin; $colspan = 'colspan="'.$nbrGridCols[$get_date].'"'; $replace = str_replace('{COLSPAN}', $colspan, $replace); - if (is_array($master_array[$get_date]['-1']) && !empty($master_array[$get_date]['-1']) ) { + if (isset($master_array[$get_date]['-1']) && is_array($master_array[$get_date]['-1']) && !empty($master_array[$get_date]['-1']) ) { foreach ($master_array[$get_date]['-1'] as $uid => $allday) { $event_calno = $allday['calnumber']; $event_calno = (($event_calno - 1) % $phpiCal_config->unique_colors) + 1; @@ -350,6 +354,7 @@ class Page { $event_length[$thisday] = array (); $thisdate = ($thisdate + (25 * 60 * 60)); } + $weekdisplay = ''; foreach ($day_array as $key) { $cal_time = $key; preg_match('/([0-9]{2})([0-9]{2})/', $key, $regs_tmp); @@ -467,7 +472,7 @@ class Page { // Start drawing the event $event_temp = $loop_event; - $event = openevent($thisday, $cal_time, $uid, $this_time_arr[$uid], $week_events_lines, 25, 'ps'); + $event = openevent($thisday, $cal_time, $uid, $this_time_arr[$uid], $phpiCal_config->week_events_lines, 25, 'ps'); $event_temp = str_replace('{EVENT}', $event, $event_temp); $event_temp = str_replace('{EVENT_START}', $event_start, $event_temp); $event_temp = str_replace('{CONFIRMED}', $confirmed, $event_temp); @@ -738,10 +743,12 @@ class Page { preg_match("!<\!-- switch t_event on -->(.*)<\!-- switch t_event off -->!Uis", $this->page, $match2); $loop_t_ad = trim($match1[1]); $loop_t_e = trim($match2[1]); + $replace_ad = ''; + $replace_e = ''; $return_adtmp = ''; $return_etmp = ''; - if (is_array($master_array[$next_day]) && sizeof($master_array[$next_day]) > 0) { + if (isset($master_array[$next_day]) && is_array($master_array[$next_day]) && sizeof($master_array[$next_day]) > 0) { foreach ($master_array[$next_day] as $cal_time => $event_times) { foreach ($event_times as $uid => $val) { $event_text = stripslashes(urldecode($val["event_text"])); @@ -811,7 +818,7 @@ class Page { document.todo_popup_data[$todo_popup_data_index] = todoData; // -->"; - $todo .= ''; + $todo .= ''; $todo_popup_data_index++; $vtodo_array = $todo; @@ -1015,7 +1022,7 @@ class Page { # $switch['START_DATE'] = localizeDate ($dateFormat_week_list, $u_start); $start_date = localizeDate ($dateFormat_week_list, $u_start); foreach ($event_times as $uid => $val) { - if (isset($seen_events[$uid]) && $val['spans_day'] == 1) continue; + if (isset($seen_events[$uid]) && @$val['spans_day'] == 1) continue; $seen_events[$uid] = 1; $switch['CAL'] = $cal; $switch['START_DATE'] = $start_date; diff --git a/includes/event.php b/includes/event.php index c8c5865..faedd21 100644 --- a/includes/event.php +++ b/includes/event.php @@ -1,4 +1,5 @@ [:space:]]+[[:alnum:]/]",'\0',$event['description']); -if (is_array($organizer)) { +$organizer = ''; +if (isset($organizer) && is_array($organizer)) { $i=0; - $display .= $organizer_lang . ' - '; + $display .= $lang['l_organizer'] . ' - '; foreach ($organizer as $val) { $organizers .= $organizer[$i]["name"] . ', '; $i++; } $organizer = substr($organizers,0,-2); } -if (is_array($attendee)) { +$attendees = ''; +if (isset($attendee) && is_array($attendee)) { $i=0; - $display .= $attendee_lang . ' - '; + $display .= $lang['l_attendee'] . ' - '; foreach ($attendee as $val) { $attendees .= $attendee[$i]["name"] . ', '; $i++; @@ -51,13 +54,13 @@ if (is_array($attendee)) { $attendee = substr($attendees,0,-2); } -if ($event['location']) { +if (isset($event['location'])) { if ($event['url'] != '') $event['location'] = ''.stripslashes($event['location']).''; }else{ $event['location'] = stripslashes($event['location']); } -if (!$event['location'] && $event['url']) { +if (!isset($event['location']) && isset($event['url'])) { $event['location'] = ''.$event['url'].''; $lang['l_location'] = 'URL'; } @@ -79,10 +82,10 @@ switch ($event['status']){ $event['status'] = '' ; } -$page = new Page(BASE.'templates/'.$template.'/event.tpl'); +$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/event.tpl'); $page->replace_tags(array( - 'charset' => $charset, + 'charset' => $phpiCal_config->charset, 'cal' => $event['calname'], 'event_text' => $event['event_text'], 'event_times' => $event_times, @@ -92,7 +95,7 @@ $page->replace_tags(array( 'status' => $event['status'], 'location' => stripslashes($event['location']), 'cal_title_full' => $event['calname'].' '.$lang['l_calendar'], - 'template' => $template, + 'template' => $phpiCal_config->template, 'l_organizer' => $lang['l_organizer'], 'l_attendee' => $lang['l_attendee'], 'l_status' => $lang['l_status'], diff --git a/includes/todo.php b/includes/todo.php index 6823405..1cefcdc 100644 --- a/includes/todo.php +++ b/includes/todo.php @@ -4,7 +4,7 @@ define('BASE', '../'); include_once(BASE.'functions/init.inc.php'); include_once(BASE.'functions/date_functions.php'); require_once(BASE.'functions/template.php'); - +$current_view = 'todo'; $vtodo_array = unserialize(urldecode(base64_decode($_REQUEST['todo_data']))); // Set the variables from the array @@ -25,9 +25,9 @@ $vtodo_text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'= 1 && $priority <= 4) { @@ -43,7 +43,7 @@ if ($priority >= 1 && $priority <= 4) { $page = new Page(BASE.'templates/'.$template.'/todo.tpl'); $page->replace_tags(array( - 'charset' => $charset, + 'charset' => $phpiCal_config->charset, 'cal' => $cal_title_full, 'vtodo_text' => $vtodo_text, 'description' => $description, @@ -52,7 +52,7 @@ $page->replace_tags(array( 'status' => $status, 'due_date' => $due_date, 'cal_title_full' => $cal_title_full, - 'template' => $template, + 'template' => $phpiCal_config->template, 'l_created' => $lang['l_created'], 'l_priority' => $lang['l_priority'], 'l_status' => $lang['l_status'], diff --git a/month.php b/month.php index b931740..07563e1 100644 --- a/month.php +++ b/month.php @@ -73,7 +73,7 @@ $page->replace_tags(array( 'calendar_name' => $cal_displayname, 'display_date' => $display_date, 'rss_powered' => $rss_powered, - 'default_path' => '', + 'default_path' => $phpiCal_config->default_path, 'rss_available' => '', 'rss_valid' => '', 'show_search' => $phpiCal_config->show_search, diff --git a/print.php b/print.php index 804bfe5..5c2a30a 100644 --- a/print.php +++ b/print.php @@ -3,7 +3,7 @@ define('BASE', './'); $current_view ='print'; require_once(BASE.'functions/date_functions.php'); require_once(BASE.'functions/init.inc.php'); -$start_week_time = strtotime(dateOfWeek($getdate, $week_start_day)); +$start_week_time = strtotime(dateOfWeek($getdate, $phpiCal_config->week_start_day)); $end_week_time = $start_week_time + (6 * 25 * 60 * 60); $parse_month = date ("Ym", strtotime($getdate)); $events_week = 0; @@ -41,7 +41,7 @@ if ($printview == 'day') { require_once(BASE.'functions/ical_parser.php'); require_once(BASE.'functions/list_functions.php'); require_once(BASE.'functions/template.php'); -header("Content-Type: text/html; charset=$charset"); +header("Content-Type: text/html; charset=$phpiCal_config->charset"); $page = new Page(BASE.'templates/'.$template.'/print.tpl'); @@ -64,21 +64,21 @@ $page->replace_tags(array( 'current_view' => $current_view, 'printview' => $printview, 'display_date' => $display_date, - 'sidebar_date' => $sidebar_date, + 'sidebar_date' => @$sidebar_date, 'rss_powered' => $rss_powered, 'rss_available' => '', 'rss_valid' => '', 'show_search' => '', - 'next_day' => $next_day, - 'prev_day' => $prev_day, + 'next_day' => @$next_day, + 'prev_day' => @$prev_day, 'show_goto' => '', 'is_logged_in' => '', - 'list_icals' => $list_icals, - 'list_years' => $list_years, - 'list_months' => $list_months, - 'list_weeks' => $list_weeks, - 'list_jumps' => $list_jumps, - 'legend' => $list_calcolors, + 'list_icals' => @$list_icals, + 'list_years' => @$list_years, + 'list_months' => @$list_months, + 'list_weeks' => @$list_weeks, + 'list_jumps' => @$list_jumps, + 'legend' => @$list_calcolors, 'style_select' => @$style_select, 'l_time' => $lang['l_time'], 'l_summary' => $lang['l_summary'], diff --git a/rss/index.php b/rss/index.php index 1d265db..f36ecbd 100644 --- a/rss/index.php +++ b/rss/index.php @@ -1,8 +1,7 @@ enable_rss != 'yes') { } if (empty($default_path)) { - if (isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on' ) { + if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) { $default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/')); } else { $default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/')); @@ -40,21 +39,21 @@ foreach ($filelist as $file) { /* Changed to show links without urlencode, but links valid urls */ $rss_list .= "".$lang['l_day'].""; - $rss_list .= ''.$xml_icon.' RSS 0.91'; - $rss_list .= ''.$xml_icon.' RSS 1.0'; - $rss_list .= ''.$xml_icon.' RSS 2.0'; + $rss_list .= ''.$xml_icon.' RSS 0.91'; + $rss_list .= ''.$xml_icon.' RSS 1.0'; + $rss_list .= ''.$xml_icon.' RSS 2.0'; $rss_list .= "".$lang['l_week'].""; - $rss_list .= ''.$xml_icon.' RSS 0.91'; - $rss_list .= ''.$xml_icon.' RSS 1.0'; - $rss_list .= ''.$xml_icon.' RSS 2.0'; + $rss_list .= ''.$xml_icon.' RSS 0.91'; + $rss_list .= ''.$xml_icon.' RSS 1.0'; + $rss_list .= ''.$xml_icon.' RSS 2.0'; $rss_list .= "".$lang['l_month'].""; - $rss_list .= ''.$xml_icon.' RSS 0.91'; - $rss_list .= ''.$xml_icon.' RSS 1.0'; - $rss_list .= ''.$xml_icon.' RSS 2.0'; + $rss_list .= ''.$xml_icon.' RSS 0.91'; + $rss_list .= ''.$xml_icon.' RSS 1.0'; + $rss_list .= ''.$xml_icon.' RSS 2.0'; - $footer_check = $default_path.'/rss/rss.php?cal%3D'.rawurlencode($file.'&cpath='.$cpath.'&rssview='.$default_view); + $footer_check = $phpiCal_config->default_path.'/rss/rss.php?cal%3D'.rawurlencode($file.'&cpath='.$cpath.'&rssview='.$phpiCal_config->default_view); $validrss_check = str_replace('%', '%25', $footer_check); $rss_list .= " \n"; @@ -65,34 +64,34 @@ $rss_list .= "\n"; /* End link modification */ -$page = new Page(BASE.'templates/'.$template.'/rss_index.tpl'); +$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/rss_index.tpl'); $page->replace_files(array( - 'header' => BASE.'templates/'.$template.'/header.tpl', - 'footer' => BASE.'templates/'.$template.'/footer.tpl', + 'header' => BASE.'templates/'.$phpiCal_config->template.'/header.tpl', + 'footer' => BASE.'templates/'.$phpiCal_config->template.'/footer.tpl', 'event_js' => '' )); $page->replace_tags(array( - 'version' => $phpicalendar_version, - 'default_path' => $default_path.'/', - 'template' => $template, + 'version' => $phpiCal_config->phpicalendar_version, + 'default_path' => $phpiCal_config->default_path.'/', + 'template' => $phpiCal_config->template, 'cal' => $cal, 'getdate' => $getdate, 'calendar_name' => $calendar_name, 'display_date' => $display_date, 'current_view' => $current_view, - 'sidebar_date' => $sidebar_date, + 'sidebar_date' => @$sidebar_date, 'rss_powered' => $rss_powered, 'rss_list' => $rss_list, - 'charset' => $charset, + 'charset' => $phpiCal_config->charset, 'rss_available' => '', 'rssdisable' => '', 'rss_valid' => '', 'rss_docinfo' => "RSS feeds can also be set up for a specified number of days before or after a given date, or between two dates. See the documentation for how to set up the URLs", /* Replaces footer.tpl {validrss_check} with $validrss_check */ 'validrss_check' => $validrss_check, - 'show_search' => $show_search, + 'show_search' => $phpiCal_config->show_search, 'l_rss_info' => $lang['l_rss_info'], 'l_rss_subhead' => $lang['l_rss_subhead'], 'l_day' => $lang['l_day'], diff --git a/rss/rss.php b/rss/rss.php index e6942a4..918e104 100644 --- a/rss/rss.php +++ b/rss/rss.php @@ -20,7 +20,7 @@ function rss_top(){ if ($theview !=""){$rss .= ' - '.$theview;} $rss .= "\n"; - $rss .= ''.htmlspecialchars("$default_path").''."\n"; + $rss .= ''.htmlspecialchars("$phpiCal_config->default_path").''."\n"; if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath"; $rss .= "$rss_link\n"; diff --git a/rss/rss1.0.php b/rss/rss1.0.php index 78c5491..813b368 100755 --- a/rss/rss1.0.php +++ b/rss/rss1.0.php @@ -19,7 +19,7 @@ function rss_top(){ xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">'."\n"; - $rss .= 'default_path.'/rss/rss.php/'; if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath"; $rss .='">'."\n"; @@ -48,8 +48,8 @@ function rss_item(){ # $rss .= ''.$rss_link.$uid.''."\n"; /* End guid modification */ $rss_item .= ''.$rss_title.''."\n"; - $rss .= ''.date("Y-m-d\TH:i:s", $val["start_unixtime"]).''."\n"; - $rss .= ''.date("Y-m-d\TH:i:s", $val["end_unixtime"]).''."\n"; + $rss .= ''.date("Y-m-d\TH:i:s", @$val["start_unixtime"]).''."\n"; + $rss .= ''.date("Y-m-d\TH:i:s", @$val["end_unixtime"]).''."\n"; $rss_item .= ''.$rss_link.''."\n"; $rss_item .= ''.$rss_description.''."\n"; diff --git a/rss/rss2.0.php b/rss/rss2.0.php index 05ac5ba..f80dbee 100644 --- a/rss/rss2.0.php +++ b/rss/rss2.0.php @@ -37,7 +37,7 @@ function rss_top(){ if ($theview !=""){$rss .= ' - '.$theview;} $rss .= "\n"; - $rss .= ''.$default_path.'/rss/rss2.0.php/'; + $rss .= ''.$phpiCal_config->default_path.'/rss/rss2.0.php/'; if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath"; $rss .=''."\n"; $rss .= ''.$cal_displayname.' '.$lang['l_calendar'].' - '.$theview.''."\n"; @@ -60,8 +60,8 @@ function rss_item(){ $rss .= ''.$rss_link.'&uid='.$uid.''."\n"; /* End guid modification */ $rss .= ''.$rss_title.''."\n"; - $rss .= ''.date("Y-m-d\TH:i:s", $val["start_unixtime"]).''."\n"; - $rss .= ''.date("Y-m-d\TH:i:s", $val["end_unixtime"]).''."\n"; + $rss .= ''.date("Y-m-d\TH:i:s", @$val["start_unixtime"]).''."\n"; + $rss .= ''.date("Y-m-d\TH:i:s", @$val["end_unixtime"]).''."\n"; $rss .= ''.$rss_link.''."\n"; $rss .= ''.$rss_description.''."\n"; diff --git a/rss/rss_common.php b/rss/rss_common.php index 9a7fd4f..e36ceba 100644 --- a/rss/rss_common.php +++ b/rss/rss_common.php @@ -21,7 +21,7 @@ Lines modified: 135-165, 208-223 Additional mods by J. Hu */ - +$current_view = 'rss'; require(BASE.'functions/init.inc.php'); if ($phpiCal_config->enable_rss != 'yes') { @@ -122,7 +122,7 @@ header ("ETag:\"$filemodtime\""); // checks the user agents headers to see if they kept track of our // stuff, if so be nice and send back a 304 and exit. -if ( ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $filemodtime) || ($_SERVER['HTTP_IF_NONE_MATCH'] == $filemodtime)){ +if ( (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] == $filemodtime) || (@$_SERVER['HTTP_IF_NONE_MATCH'] == $filemodtime)){ header ("HTTP/1.1 304 Not Modified"); exit; } @@ -154,7 +154,7 @@ do { foreach ($master_array[("$thisdate")] as $event_times) { foreach ($event_times as $uid=>$val) { #handle multiday all day events - if(!$val["event_start"]){ + if(!isset($val["event_start"])){ if (isset($uid_arr[$uid])){ $uid_arr[$uid] .= "+$dayofweek" ; continue; diff --git a/week.php b/week.php index 4f9ddbd..80cc53d 100644 --- a/week.php +++ b/week.php @@ -56,7 +56,7 @@ $page->replace_files(array( $page->replace_tags(array( 'version' => $phpiCal_config->phpicalendar_version, 'charset' => $phpiCal_config->charset, - 'default_path' => '', + 'default_path' => $phpiCal_config->default_path, 'template' => $phpiCal_config->template, 'cal' => $cal, 'getdate' => $getdate, diff --git a/year.php b/year.php index 9bcf802..6a0a6d0 100644 --- a/year.php +++ b/year.php @@ -57,7 +57,7 @@ $page->replace_tags(array( 'current_view' => $current_view, 'template' => $phpiCal_config->template, 'charset' => $phpiCal_config->charset, - 'default_path' => '', + 'default_path' => $phpiCal_config->default_path, 'cal' => $cal, 'getcpath' => "&cpath=$cpath", 'cpath' => $cpath, @@ -71,10 +71,10 @@ $page->replace_tags(array( 'todo_available' => '', 'event_js' => '', 'this_year' => $this_year, - 'next_day' => $next_day, - 'next_week' => $next_week, - 'prev_day' => $prev_day, - 'prev_week' => $prev_week, + 'next_day' => @$next_day, + 'next_week' => @$next_week, + 'prev_day' => @$prev_day, + 'prev_week' => @$prev_week, 'next_year' => $next_year, 'prev_year' => $prev_year, 'show_goto' => '', @@ -91,7 +91,7 @@ $page->replace_tags(array( 'list_weeks' => $list_weeks, 'list_jumps' => $list_jumps, 'legend' => $list_calcolors, - 'style_select' => $style_select, + 'style_select' => @$style_select, 'l_goprint' => $lang['l_goprint'], 'l_preferences' => $lang['l_preferences'], 'l_calendar' => $lang['l_calendar'], -- cgit v1.2.3