From: <cl...@us...> - 2003-09-15 01:00:48
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1:/tmp/cvs-serv9108/functions Modified Files: admin_functions.php ical_parser.php init.inc.php list_icals.php Log Message: Fix for bug #794853 listing dot-files. Index: admin_functions.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/admin_functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_functions.php 30 May 2003 00:45:20 -0000 1.2 --- admin_functions.php 15 Sep 2003 01:00:44 -0000 1.3 *************** *** 295,299 **** $filelist = array(); while ($file = readdir($dir_handle)) { ! if (substr($file, -4) == ".ics") { array_push($filelist, $file); } --- 295,299 ---- $filelist = array(); while ($file = readdir($dir_handle)) { ! if (preg_match("/^[^.].+\.ics$/", $file)) { array_push($filelist, $file); } Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** ical_parser.php 13 Aug 2003 05:37:36 -0000 1.93 --- ical_parser.php 15 Sep 2003 01:00:44 -0000 1.94 *************** *** 884,901 **** case 'DURATION': if (($first_duration == TRUE) && (!stristr($field, '=DURATION'))) { ! ereg ('^P([0-9]{1,2})?([W,D]{0,1}[T])?([0-9]{1,2}[H])?([0-9]{1,2}[M])?([0-9]{1,2}[S])?', $data, $duration); ! if ($duration[2] = 'W') { ! $weeks = $duration[1]; ! $days = 0; ! } else { ! $days = $duration[1]; ! $weeks = 0; ! } ! $hours = ereg_replace('H', '', $duration[3]); ! $minutes = ereg_replace('M', '', $duration[4]); ! $seconds = ereg_replace('S', '', $duration[5]); ! $the_duration = ($weeks * 60 * 60 * 24 * 7) + ($days * 60 * 60 * 24) + ($hours * 60 * 60) + ($minutes * 60) + ($seconds); ! $end_unixtime = $start_unixtime + $the_duration; ! $end_time = date ('Hi', $end_unixtime); $first_duration = FALSE; } --- 884,896 ---- case 'DURATION': if (($first_duration == TRUE) && (!stristr($field, '=DURATION'))) { ! ereg ('^P([0-9]{1,2}[W])?([0-9]{1,2}[D])?([T]{0,1})?([0-9]{1,2}[H])?([0-9]{1,2}[M])?([0-9]{1,2}[S])?', $data, $duration); ! $weeks = ereg_replace('W', '', $duration[1]); ! $days = ereg_replace('D', '', $duration[2]); ! $hours = ereg_replace('H', '', $duration[4]); ! $minutes = ereg_replace('M', '', $duration[5]); ! $seconds = ereg_replace('S', '', $duration[6]); ! $the_duration = ($weeks * 60 * 60 * 24 * 7) + ($days * 60 * 60 * 24) + ($hours * 60 * 60) + ($minutes * 60) + ($seconds); ! $end_unixtime = $start_unixtime + $the_duration; ! $end_time = date ('Hi', $end_unixtime); $first_duration = FALSE; } *************** *** 927,970 **** } } - - /* - //print '<pre>'; - // Remove pesky recurrences - if (is_array($recurrence_delete)) { - foreach ($recurrence_delete as $delete => $delete_key) { - foreach ($delete_key as $key => $val) { - #echo "Before Delete:: $delete $key $val<br>"; - #print_r($master_array["$delete"]); - if (is_array($master_array[($delete)][($key)][($val)])) { - removeOverlap($delete, $key, $val); - unset($master_array["$delete"]["$key"]["$val"]); - // Remove date from array if no events - if (sizeof($master_array["$delete"]["$key"] = 1)) { - #echo "deleting $delete $key $val<br>"; - unset($master_array["$delete"]["$key"]); - if (!sizeof($master_array["$delete"] > 1)) { - #echo "deleting $delete $key $val<br>"; - unset($master_array["$delete"]); - } - } - #print_r($master_array["$delete"]); - // Check for overlaps and rewrite them - foreach($master_array["$delete"] as $overlap_time => $overlap_val) { - $recur_data_date = $delete; - foreach ($overlap_val as $uid => $val) { - $start_time = $val['event_start']; - $end_time = $val['event_end']; - #$nbrOfOverlaps = checkOverlap($recur_data_date, $start_time, $end_time, $uid); - #$master_array[($recur_data_date)][($start_time)][($uid)]['event_overlap'] = 0; - #echo "$recur_data_date - $uid - $start_time - $end_time - $nbrOfOverlaps<br>"; - #print_r($val); - } - } - } - } - } - } - - */ } $calnumber = $calnumber + 1; --- 922,925 ---- Index: init.inc.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/init.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** init.inc.php 13 Aug 2003 05:37:36 -0000 1.34 --- init.inc.php 15 Sep 2003 01:00:44 -0000 1.35 *************** *** 107,111 **** // build the array while (false != ($file = readdir($dir_handle))) { ! if (substr($file, -4) == ".ics") { $file = $calendar_path.'/'.$file; array_push($cal_filelist, $file); --- 107,111 ---- // build the array while (false != ($file = readdir($dir_handle))) { ! if (preg_match("/^[^.].+\.ics$/", $file)) { $file = $calendar_path.'/'.$file; array_push($cal_filelist, $file); *************** *** 114,118 **** // add webcals foreach ($list_webcals as $file) { ! if (substr($file, -4) == ".ics") { array_push($cal_filelist, $file); } --- 114,118 ---- // add webcals foreach ($list_webcals as $file) { ! if (preg_match("/^[^.].+\.ics$/", $file)) { array_push($cal_filelist, $file); } Index: list_icals.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/list_icals.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** list_icals.php 30 Jun 2003 22:48:25 -0000 1.13 --- list_icals.php 15 Sep 2003 01:00:44 -0000 1.14 *************** *** 18,22 **** // build the <option> tags while (false != ($file = readdir($dir_handle))) { ! if (substr($file, -4) == ".ics") { array_push($filelist, $file); } --- 18,22 ---- // build the <option> tags while (false != ($file = readdir($dir_handle))) { ! if (preg_match("/^[^.].+\.ics$/", $file)) { array_push($filelist, $file); } |