$nl = "\r\n";
if(isset($cal)){
$calendar = OC_Calendar_App::getCalendar($cal, true);
+ if(!$calendar){
+ header('HTTP/1.0 404 Not Found');
+ exit;
+ }
$calobjects = OC_Calendar_Object::all($cal);
header('Content-Type: text/Calendar');
header('Content-Disposition: inline; filename=' . $calendar['displayname'] . '.ics');
}
}elseif(isset($event)){
$data = OC_Calendar_App::getEventObject($_GET['eventid'], true);
+ if(!$data){
+ header('HTTP/1.0 404 Not Found');
+ exit;
+ }
$calendarid = $data['calendarid'];
$calendar = OC_Calendar_App::getCalendar($calendarid);
header('Content-Type: text/Calendar');