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 --- rss/index.php | 45 ++++++++++++++++++++++----------------------- rss/rss.php | 2 +- rss/rss1.0.php | 6 +++--- rss/rss2.0.php | 6 +++--- rss/rss_common.php | 6 +++--- 5 files changed, 32 insertions(+), 33 deletions(-) (limited to 'rss') 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; -- cgit v1.2.3