diff options
author | Chad Little <clittle@users.sourceforge.net> | 2003-08-13 05:37:35 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2003-08-13 05:37:35 +0000 |
commit | cd1418522aef81f48a51ac6c317eb6c3ea9cadd0 (patch) | |
tree | 2c6774a008148d4bfbbd03f79c73e659f9e5d409 /functions/init.inc.php | |
parent | 01bd2298c52fd6556f6649cd9ec79893aa50d47f (diff) | |
download | phpicalendar-cd1418522aef81f48a51ac6c317eb6c3ea9cadd0.tar.gz phpicalendar-cd1418522aef81f48a51ac6c317eb6c3ea9cadd0.tar.bz2 phpicalendar-cd1418522aef81f48a51ac6c317eb6c3ea9cadd0.zip |
Bug fixes, prepped for 0.9.3, added webcal as default support, fixed extra <BR> tags.
Diffstat (limited to 'functions/init.inc.php')
-rw-r--r-- | functions/init.inc.php | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/functions/init.inc.php b/functions/init.inc.php index 3033e76..db76044 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -51,15 +51,7 @@ if ($calendar_path == '') { $is_webcal = FALSE; if (isset($HTTP_GET_VARS['cal']) && $HTTP_GET_VARS['cal'] != '') { - $cal_decoded = urldecode($HTTP_GET_VARS['cal']); - if (substr($cal_decoded, 0, 7) == 'http://' || substr($cal_decoded, 0, 9) == 'webcal://') { - $is_webcal = TRUE; - $cal_webcalPrefix = str_replace('http://','webcal://',$cal_decoded); - $cal_httpPrefix = str_replace('webcal://','http://',$cal_decoded); - $cal_filename = $cal_httpPrefix; - } else { - $cal_filename = stripslashes($cal_decoded); - } + $cal_filename = urldecode($HTTP_GET_VARS['cal']); } else { if (isset($default_cal_check)) { if ($default_cal_check != 'all_calenders_combined971') { @@ -78,6 +70,12 @@ if (isset($HTTP_GET_VARS['cal']) && $HTTP_GET_VARS['cal'] != '') { } } +if (substr($cal_filename, 0, 7) == 'http://' || substr($cal_filename, 0, 9) == 'webcal://') { + $is_webcal = TRUE; + $cal_webcalPrefix = str_replace('http://','webcal://',$cal_filename); + $cal_httpPrefix = str_replace('webcal://','http://',$cal_filename); + $cal_filename = $cal_httpPrefix; +} if ($is_webcal) { if ($allow_webcals == 'yes' || in_array($cal_webcalPrefix, $list_webcals) || in_array($cal_httpPrefix, $list_webcals)) { @@ -85,6 +83,9 @@ if ($is_webcal) { $cal = urlencode($cal_filename); $filename = $cal_filename; $subscribe_path = $cal_webcalPrefix; + // empty the filelist array + $cal_filelist = array(); + array_push($cal_filelist,$filename); } else { exit(error($error_remotecal_lang, $HTTP_GET_VARS['cal'])); } @@ -110,6 +111,12 @@ if ($is_webcal) { array_push($cal_filelist, $file); } } + // add webcals + foreach ($list_webcals as $file) { + if (substr($file, -4) == ".ics") { + array_push($cal_filelist, $file); + } + } natcasesort($cal_filelist); } else { // Handle a single file $filename = $calendar_path.'/'.$cal_filename.'.ics'; @@ -139,4 +146,4 @@ if ($is_webcal) { } } -?>
\ No newline at end of file +?> |