diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-05-25 23:29:49 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-05-25 23:29:49 +0000 |
commit | ef687e7ade702bf9b684c9651cfa1463f9c0adaa (patch) | |
tree | 1cb67c592dbffdb9f343d1df59303e21ed71f11b | |
parent | 3c2d1a971c805dc983c56fa032f538b6a7aa12c2 (diff) | |
download | phpicalendar-ef687e7ade702bf9b684c9651cfa1463f9c0adaa.tar.gz phpicalendar-ef687e7ade702bf9b684c9651cfa1463f9c0adaa.tar.bz2 phpicalendar-ef687e7ade702bf9b684c9651cfa1463f9c0adaa.zip |
Minor E_NOTICE fixes.
-rw-r--r-- | functions/ical_parser.php | 3 | ||||
-rw-r--r-- | functions/init.inc.php | 22 |
2 files changed, 15 insertions, 10 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php index aef5911..5a9f3f1 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -158,6 +158,8 @@ foreach ($cal_filelist as $filename) { if (!isset($master_array[-3][$calnumber])) $master_array[-3][$calnumber] = $actual_calname; if (!isset($master_array[-4][$calnumber]['mtime'])) $master_array[-4][$calnumber]['mtime'] = $actual_mtime; if (!isset($master_array[-4][$calnumber]['filename'])) $master_array[-4][$calnumber]['filename'] = $filename; + if (!isset($url)) $url = ''; + if (!isset($type)) $type = ''; // Handle DURATION if (!isset($end_unixtime) && isset($the_duration)) { @@ -515,6 +517,7 @@ foreach ($cal_filelist as $filename) { case 'MONTHLY': if (!isset($bymonth)) $bymonth = array(1,2,3,4,5,6,7,8,9,10,11,12); $next_range_time = strtotime(date('Y-m-01', $next_range_time)); + $next_date_time = $next_date_time; if ((isset($bymonthday)) && (!isset($byday))) { foreach($bymonthday as $day) { $year = date('Y', $next_range_time); diff --git a/functions/init.inc.php b/functions/init.inc.php index cfda336..a691aee 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -128,16 +128,18 @@ if ($is_webcal) { } // Sets the download and subscribe paths from the config if present. - if ($download_uri == '' && preg_match('/(^\/|\.\.\/)/', $filename) == 0) { - $subscribe_path = 'webcal://'.$HTTP_SERVER_VARS['SERVER_NAME'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/'.$filename; - $download_filename = $filename; - } elseif ($download_uri != '') { - $newurl = eregi_replace("^(http://)", "", $download_uri); - $subscribe_path = 'webcal://'.$newurl.'/'.$cal_filename.'.ics'; - $download_filename = $download_uri.'/'.$cal_filename.'.ics'; - } else { - $subscribe_path = ''; - $download_filename = ''; + if (isset($filename)) { + if (($download_uri == '') && (preg_match('/(^\/|\.\.\/)/', $filename) == 0)) { + $subscribe_path = 'webcal://'.$HTTP_SERVER_VARS['SERVER_NAME'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/'.$filename; + $download_filename = $filename; + } elseif ($download_uri != '') { + $newurl = eregi_replace("^(http://)", "", $download_uri); + $subscribe_path = 'webcal://'.$newurl.'/'.$cal_filename.'.ics'; + $download_filename = $download_uri.'/'.$cal_filename.'.ics'; + } else { + $subscribe_path = ''; + $download_filename = ''; + } } } } |