diff --git a/index.php b/index.php index 5d34985..ba9b6d4 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,13 @@ iCalDateToDateTime($event->dtstart_array[3])->format(DateTime::ATOM); $result[$date][$uid]["dtend"] = $iCal->iCalDateToDateTime($event->dtend_array[3])->format(DateTime::ATOM); - $result[$date][$uid]["datestr"] = (isset($event->dtstart_array[0]["VALUE"]) && $event->dtstart_array[0]["VALUE"] == 'DATE')?'Ganztägig':$start->format('H:i'); - $result[$date][$uid]["summary"] = $event->summary; - $result[$date][$uid]["location"] = $event->location; - $result[$date][$uid]["description"] = $event->description; + $result[$date][$uid]["datestr"] = (isset($event->dtstart_array[0]["VALUE"]) && $event->dtstart_array[0]["VALUE"] == 'DATE')?'':$start->format('H:i'); + $result[$date][$uid]["summary"] = mb_strimwidth($event->summary, 0, 255, "..."); + $result[$date][$uid]["location"] = mb_strimwidth($event->location, 0, 255, "..."); + $result[$date][$uid]["description"] = mb_strimwidth($event->description, 0, 255, "..."); if(isset($event->categories)) $result[$date][$uid]["categories"] = $event->categories; } @@ -64,4 +69,4 @@ foreach ($events as $event) { header("Access-Control-Allow-Origin: *"); header("Content-Type: application/json"); -echo json_encode($result, JSON_PRETTY_PRINT); \ No newline at end of file +echo json_encode($result, JSON_UNESCAPED_SLASHES); \ No newline at end of file