aboutsummaryrefslogtreecommitdiffstats
path: root/functions/parse
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-28 19:30:41 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-28 19:30:41 +0000
commitd482264b6af8598ce50677ac6a8f781e219b7d6f (patch)
tree5bff034467e4ed8e1b1fe442c7de643f112da7f7 /functions/parse
parentfc3e1a8590046c858b2ddebdf6c43df8240e9a97 (diff)
downloadphpicalendar-d482264b6af8598ce50677ac6a8f781e219b7d6f.tar.gz
phpicalendar-d482264b6af8598ce50677ac6a8f781e219b7d6f.tar.bz2
phpicalendar-d482264b6af8598ce50677ac6a8f781e219b7d6f.zip
fix misc bugs; rewrite some places where warnings squelched with @; require php5.1 or greater
Diffstat (limited to 'functions/parse')
-rw-r--r--functions/parse/end_vevent.php13
-rw-r--r--functions/parse/parse_tzs.php4
-rw-r--r--functions/parse/recur_functions.php3
3 files changed, 10 insertions, 10 deletions
diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php
index 9a13bbe..27f7bd3 100644
--- a/functions/parse/end_vevent.php
+++ b/functions/parse/end_vevent.php
@@ -177,8 +177,9 @@ foreach ($rrule_array as $key => $val) {
break;
}
}
+# convert wkst to a 3 char day for strtotime to work
+$wkst3char = two2threeCharDays($wkst);
if($current_view == 'search') $freq_type = 'none';
-
# $recur is the recurrence info that goes into the master array for this VEVENT
$recur = @$recur_array[($start_date)][($hour.$minute)][$uid]['recur'];
@@ -206,16 +207,16 @@ $start_date_unixtime = strtotime($start_date);
$next_range_unixtime = $start_date_unixtime;
# conditions where we don't need to iterate over the whole range
-# if repeating without limit, and steps are by 1, don't go back before the mArray beginning.
+# if repeating without limit, and steps are by 1, don't go back before the mArray beginning.
if($count == 1000000 && $interval == 1 && $mArray_begin > $next_range_unixtime) $next_range_unixtime = $mArray_begin;
-# if the beginning of our range is less than the start of the item, we may as well set the range to start at start_time
+# if the beginning of our range is less than the start of the item, we may as well set the range to start at start_time
if ($next_range_unixtime < $start_date_unixtime) $next_range_unixtime = $start_date_unixtime;
-# stop at the until limit if set
+# stop at the until limit if set
if(isset($until) && $end_range_unixtime > $until_unixtime) $end_range_unixtime = $until_unixtime;
-# more adjustments
+# more adjustments
switch ($freq_type){
case 'week':
# need to get the first value of $next_range_unixtime onto the right day of the week
@@ -231,8 +232,6 @@ if(!isset($rrule_array['FREQ']) && isset($end_date)){
$end_range_unixtime = strtotime($end_date);
$count = 1;
}
-// convert wkst to a 3 char day for strtotime to work
-$wkst3char = two2threeCharDays($wkst);
/* The while loop below increments $next_range_time by $freq type. For the larger freq types, there is only
one $next_range_time per repeat, but the BYXXX rules may write more than one event in that repeat cycle
diff --git a/functions/parse/parse_tzs.php b/functions/parse/parse_tzs.php
index a135b0f..8b02cb5 100644
--- a/functions/parse/parse_tzs.php
+++ b/functions/parse/parse_tzs.php
@@ -1,8 +1,8 @@
<?php
$ifile = @fopen($filename, "r");
-if ($ifile == FALSE) exit(error($lang['l_error_cantopen']." parse_tz", $filename));
+if ($ifile == FALSE) exit(error($lang['l_error_cantopen'], $filename));
$nextline = fgets($ifile);
-if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal']." parse_tz", $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
diff --git a/functions/parse/recur_functions.php b/functions/parse/recur_functions.php
index 0526e1d..e936c64 100644
--- a/functions/parse/recur_functions.php
+++ b/functions/parse/recur_functions.php
@@ -1,4 +1,4 @@
-<?php
+<?php
/* from the std
"BYxxx rule parts modify the recurrence in some manner. BYxxx rule parts for a period of time which is the same or greater than the frequency generally reduce or limit the number of occurrences of the recurrence generated. For example, "FREQ=DAILY;BYMONTH=1" reduces the number of recurrence instances from all days (if BYMONTH tag is not present) to all days in January. BYxxx rule parts for a period of time less than the frequency generally increase or expand the number of occurrences of the recurrence. For example, "FREQ=YEARLY;BYMONTH=1,2" increases the number of days within the yearly recurrence set from 1 (if BYMONTH tag is not present) to 2.
@@ -28,6 +28,7 @@ function add_recur($times,$freq=''){
$until_date = date("Ymd",$end_range_unixtime);
foreach ($times as $time){
#echo "time:". date("Ymd",$time)."\n";
+ if (!isset($time) || $time == '') continue;
$date = date("Ymd",$time);
$time = strtotime("$date 12:00:00");
# day offset fixes shifts across day boundaries due to time diffs.

© 2014-2024 Faster IT GmbH | imprint | privacy policy