]> source.dussan.org Git - nextcloud-server.git/commitdiff
some fixes for calendar's export.php
authorGeorg Ehrke <dev@georgswebsite.de>
Mon, 14 May 2012 13:52:24 +0000 (15:52 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Mon, 14 May 2012 13:52:24 +0000 (15:52 +0200)
apps/calendar/export.php

index 0756e1df20e3cda05b31ff760e28d8c124b1f329..5780d191a57bd308c2aa7ac0344c67801aaa28d3 100755 (executable)
@@ -14,6 +14,10 @@ $event = isset($_GET['eventid']) ? $_GET['eventid'] : NULL;
 $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'); 
@@ -22,6 +26,10 @@ if(isset($cal)){
        }
 }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');