From: <cl...@us...> - 2003-09-21 20:02:58
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1:/tmp/cvs-serv4382/functions Modified Files: ical_parser.php Log Message: Added a fix for when peeps write calendar start times before 1970 (when unix started). Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** ical_parser.php 21 Sep 2003 18:18:19 -0000 1.109 --- ical_parser.php 21 Sep 2003 20:02:54 -0000 1.110 *************** *** 388,391 **** --- 388,392 ---- case 'END': + if (!isset($number)) $number = 1; // if $until isn't set yet, we set it to the end of our range we're looking at // The FREQ switch array will always kick our early, so lets try this workaround. *************** *** 495,499 **** break; case 'YEARLY': ! if (!isset($bymonth)) $bymonth[] = date('m', $start_date_time); foreach($bymonth as $month) { $year = date('Y', $next_range_time); --- 496,504 ---- break; case 'YEARLY': ! ! if (!isset($bymonth)) { ! $m = date('m', $start_date_time); ! $bymonth = array("$m"); ! } foreach($bymonth as $month) { $year = date('Y', $next_range_time); *************** *** 765,768 **** --- 770,778 ---- $field = ereg_replace(';VALUE=DATE-TIME', '', $field); if (preg_match("/^DTSTART;VALUE=DATE/i", $field)) { + ereg ('([0-9]{4})([0-9]{2})([0-9]{2})', $data, $dtstart_check); + if ($dtstart_check[1] < 1969) { + $dtstart_check[1] = '1990'; + $data = $dtstart_check[1].$dtstart_check[2].$dtstart_check[3]; + } $allday_start = $data; $start_date = $allday_start; |