From 77e0833ddd20afc10957d38ee2c954c221ac3de8 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Wed, 23 Nov 2005 07:51:01 +0000 Subject: changes to fix bugs in handling webcals --- functions/ical_parser.php | 2 +- rss/index.php | 8 ++++++-- rss/rss.php | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 60ca5c9..aae929b 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -71,7 +71,7 @@ if ($save_parsed_cals == 'yes') { } else { foreach ($cal_filelist as $filename) { $realcal_mtime = filemtime($filename); - $parsedcal = $tmp_dir.'/parsedcal-'.$cal_filename.'-'.$this_year; + $parsedcal = $tmp_dir.'/parsedcal-'.urlencode($cal_filename).'-'.$this_year; if (file_exists($parsedcal)) { $parsedcal_mtime = filemtime($parsedcal); if ($realcal_mtime == $parsedcal_mtime) { diff --git a/rss/index.php b/rss/index.php index e888a1f..b44070b 100644 --- a/rss/index.php +++ b/rss/index.php @@ -24,8 +24,12 @@ foreach ($filelist as $file) { // $cal_filename is the filename of the calendar without .ics // $cal is a urlencoded version of $cal_filename // $cal_displayname is $cal_filename with occurrences of "32" replaced with " " - $cal_filename_tmp = getCalendarName($file); - $cal_tmp = urlencode($cal_filename_tmp); + + if (substr($file, 0, 7) == 'http://' || substr($file, 0, 8) == 'https://' || substr($file, 0, 9) == 'webcal://') { + $cal_tmp = urlencode($file); + }else{ + $cal_tmp = getCalendarName($file); + } $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp); $rss_list .= ''.$cal_displayname_tmp.' '. $calendar_lang.'
'; $rss_list .= $default_path.'/rss/rss.php?cal='.$cal_tmp.'&cpath='.$cpath.'&rssview=day
'; diff --git a/rss/rss.php b/rss/rss.php index 2f147d8..9883557 100644 --- a/rss/rss.php +++ b/rss/rss.php @@ -95,7 +95,7 @@ if ($enable_rss != 'yes') { //Note that this depends on other modifications I've made to //allow phpicalendar to use calendar subdirectories - see bbs -$cal_displayname = str_replace("32", " ", $cal); +$cal_displayname = getCalendarName(urldecode($cal)); if ($cal == $ALL_CALENDARS_COMBINED) { $temp = explode("/",$calendar_path); $cal_displayname = str_replace("32"," ",ucfirst(array_pop($temp))); -- cgit v1.2.3