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 | |
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')
-rw-r--r-- | functions/ical_parser.php | 4 | ||||
-rw-r--r-- | functions/init.inc.php | 27 |
2 files changed, 19 insertions, 12 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 98a1305..9dc4e61 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -570,7 +570,7 @@ foreach ($cal_filelist as $filename) { $vtodo_sort = $vtodo_priority; } $master_array['-2']["$vtodo_sort"]["$uid"] = array ('start_date' => $start_date, 'start_time' => $start_time, 'vtodo_text' => $summary, 'due_date'=> $due_date, 'due_time'=> $due_time, 'completed_date' => $completed_date, 'completed_time' => $completed_time, 'priority' => $vtodo_priority, 'status' => $status, 'class' => $class, 'categories' => $vtodo_categories); - unset ($due_date, $due_time, $completed_date, $completed_time, $vtodo_priority, $status, $class, $vtodo_categories, $summary); + unset ($start_date, $start_time, $due_date, $due_time, $completed_date, $completed_time, $vtodo_priority, $status, $class, $vtodo_categories, $summary); $vtodo_set = FALSE; } elseif ($line == 'BEGIN:VTODO') { $vtodo_set = TRUE; @@ -921,7 +921,7 @@ foreach ($cal_filelist as $filename) { $organizer[] = array ('name' => $field, 'email' => $data); break; case 'LOCATION': - $data = $location; + $location = $data; break; } } 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 +?> |