From ef85825abc5bd774e3554a6533fc9241ba0eac8e Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Wed, 8 Apr 2009 04:42:59 +0000 Subject: autoincrement sequence if it is missing --- functions/parse/end_vevent.php | 7 ++++--- functions/parse/parse_tzs.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'functions/parse') diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php index bd122f4..8e8186a 100644 --- a/functions/parse/end_vevent.php +++ b/functions/parse/end_vevent.php @@ -29,8 +29,8 @@ if (!isset($uid)) { $uid_counter++; $uid_valid = false; }elseif(in_array($uid, $uid_list)) { - #$uid .= $uid_counter; - #$uid_counter++; + # UID seen before. If sequence is the default, bump it. + if ($sequence == 0) $sequence++; }else{ $uid_valid = true; } @@ -321,7 +321,8 @@ foreach($recur_data as $recur_data_unixtime) { } if($this_date_tmp == $end_date_tmp && ($end_time == '0000')) continue; if(!isset($master_array[$this_date_tmp][$time_key][$uid]['sequence']) || - $sequence > $master_array[$this_date_tmp][$time_key][$uid]['sequence']){ + $sequence > $master_array[$this_date_tmp][$time_key][$uid]['sequence'] + ){ $master_array[$this_date_tmp][$time_key][$uid] = array ( 'event_start' => $start_time, # hhmm 'event_end' => $end_time, # hhmm diff --git a/functions/parse/parse_tzs.php b/functions/parse/parse_tzs.php index fb250b2..4769d69 100644 --- a/functions/parse/parse_tzs.php +++ b/functions/parse/parse_tzs.php @@ -2,7 +2,7 @@ $ifile = @fopen($filename, "r"); if ($ifile == FALSE) exit(error($lang['l_error_cantopen'], $filename)); $nextline = fgets($ifile); -if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal'], $filename)); +#if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal'], $filename)); // read file in line by line // XXX end line is skipped because of the 1-line readahead -- cgit v1.2.3