diff options
author | Wesley Miaw <josuah@users.sourceforge.net> | 2005-11-12 08:21:38 +0000 |
---|---|---|
committer | Wesley Miaw <josuah@users.sourceforge.net> | 2005-11-12 08:21:38 +0000 |
commit | b1891233a2bf73b74913fb23df5869ed54c29027 (patch) | |
tree | 68b1035cbd7125dd19850e5373fa2639f9386583 /functions/calendar_functions.php | |
parent | 59e3ffb75995ad2849f0f10e74d5b9c071642d8e (diff) | |
download | phpicalendar-b1891233a2bf73b74913fb23df5869ed54c29027.tar.gz phpicalendar-b1891233a2bf73b74913fb23df5869ed54c29027.tar.bz2 phpicalendar-b1891233a2bf73b74913fb23df5869ed54c29027.zip |
Corrected filename identification issue when selecting a specific calendar
by name, where the calendar file would fail to be found. Included a comment
explaining what is going on.
Diffstat (limited to 'functions/calendar_functions.php')
-rw-r--r-- | functions/calendar_functions.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php index a345259..b3db93c 100644 --- a/functions/calendar_functions.php +++ b/functions/calendar_functions.php @@ -67,7 +67,13 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) $files = array(); // Build the list of files we need to check. - if ($find_all || $recursive_path == 'yes') { + // + // We do a full directory search if we are supposed to find all + // calendars, the calendar we're looking for may be in a + // subdirectory, or we are supporting the iCal repository format. + // The latter is necessary because the calendar name cannot be + // used to identify the calendar filename. + if ($find_all || $recursive_path == 'yes' || $support_ical == 'yes') { // Open the directory. $dir_handle = @opendir($search_path) or die(error(sprintf($lang['l_error_path'], $search_path), $cal_filename)); @@ -81,8 +87,10 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) array_push($files, "$search_path/$file"); } } else { + // The file process block below expects actual filenames. So + // we have to append '.ics' to the passed in calendar names. foreach ($cal_filename_local as $filename) { - array_push($files, "$search_path/$filename"); + array_push($files, "$search_path/$filename\.ics"); } } |