From: <ji...@us...> - 2005-05-15 07:17:58
|
Update of /cvsroot/phpicalendar/phpicalendar/rss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10631/phpicalendar/rss Modified Files: rss.php Log Message: Bug fix for date range crossing year boundary. Other tweaks for XML validation of special chars Index: rss.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/rss/rss.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** rss.php 1 Mar 2005 05:38:55 -0000 1.25 --- rss.php 15 May 2005 07:17:49 -0000 1.26 *************** *** 31,35 **** break; case 'month': ! $parse_month = date ("Ym", strtotime($getdate)); $fromdate = ($parse_month *100) + 1; $nextmonth = ($parse_month +1) * 100; #should give the 0th day of following month --- 31,35 ---- break; case 'month': ! $parse_month = date ("Ym", strtotime($getdate)); $fromdate = ($parse_month *100) + 1; $nextmonth = ($parse_month +1) * 100; #should give the 0th day of following month *************** *** 65,69 **** //allow phpicalendar to use calendar subdirectories - see bbs ! $cal_displayname = str_replace("32", " ", $cal); if ($cal == $ALL_CALENDARS_COMBINED) { $temp = explode("/",$calendar_path); --- 65,69 ---- //allow phpicalendar to use calendar subdirectories - see bbs ! $cal_displayname = str_replace("32", " ", $cal); if ($cal == $ALL_CALENDARS_COMBINED) { $temp = explode("/",$calendar_path); *************** *** 106,110 **** //generate the items ! $numdays = $todate - $fromdate; $thisdate = $fromdate; # start at beginning of date range, # note that usage of $thisdate is different from distribution --- 106,110 ---- //generate the items ! $numdays = round((strtotime($todate) - strtotime($fromdate))/(60*60*24)-1); $thisdate = $fromdate; # start at beginning of date range, # note that usage of $thisdate is different from distribution *************** *** 127,136 **** $event_text = stripslashes(urldecode($val["event_text"])); $event_text = strip_tags($event_text, '<b><i><u>'); ! $event_text = str_replace("& ","&", $event_text); #uncomment for shorter event text with ... # $event_text = word_wrap($event_text, 21, $tomorrows_events_lines); ! $description = stripslashes(urldecode($val["description"])); ! $description = strip_tags($description, '<b><i><u>'); ! $rss_title = htmlspecialchars ("$dayofweek: $event_text"); $rss_link = htmlspecialchars ("$default_path/day.php?getdate=$getdate&cal=$cal&cpath=$cpath"); $rss_description = htmlspecialchars ("$dayofweek $event_start: $description"); --- 127,142 ---- $event_text = stripslashes(urldecode($val["event_text"])); $event_text = strip_tags($event_text, '<b><i><u>'); ! $event_text = str_replace('&','&',$event_text); ! $event_text = str_replace('&amp;','&',$event_text); ! $event_text = urlencode($event_text); #uncomment for shorter event text with ... # $event_text = word_wrap($event_text, 21, $tomorrows_events_lines); ! $description = stripslashes(urldecode($val["description"])); ! $description = strip_tags($description, '<b><i><u>'); ! $description = str_replace('&','&',$description); ! $description = str_replace('&amp;','&',$description); ! ! ! $rss_title = htmlspecialchars ("$dayofweek: $event_text"); $rss_link = htmlspecialchars ("$default_path/day.php?getdate=$getdate&cal=$cal&cpath=$cpath"); $rss_description = htmlspecialchars ("$dayofweek $event_start: $description"); *************** *** 150,154 **** $rss .= '<link>'.$rss_link.'</link>'."\n"; $rss .= '<description>'.$rss_description.'</description>'."\n"; ! $rss .= '<location>'.$val['location'].'</location>'; $rss .= '</item>'."\n"; $events_count++; --- 156,164 ---- $rss .= '<link>'.$rss_link.'</link>'."\n"; $rss .= '<description>'.$rss_description.'</description>'."\n"; ! $location = str_replace('&','&',$val['location']); ! $location = str_replace('&amp;','&',$location); ! ! ! $rss .= '<location>'.$location.'</location>'; $rss .= '</item>'."\n"; $events_count++; *************** *** 163,167 **** } $thisdate++; ! $i++; } while ($i <= $numdays); --- 173,177 ---- } $thisdate++; ! $i++; } while ($i <= $numdays); |