scopen-coop/roundcube_caldav

Calendar content treated as filename

netchild opened this issue · 2 comments

Hi,

the received calendar entry is not parsed as the content is taken as a filename:
---snip---
Sep 7 10:01:39 roundcube php[13832]: in /usr/local/www/roundcube/plugins/roundcube_caldav/vendor/johngrogg/ics-parser/src/ICal/ICal.php on line 2594
Sep 7 10:31:44 roundcube php[41163]: PHP Warning: file_exists(): File name is longer than the maximum allowed path length on this platform (1024): BEGIN:VCALENDAR\x0d
Sep 7 10:31:44 roundcube php[41163]: METHOD:CANCEL\x0d
Sep 7 10:31:44 roundcube php[41163]: PRODID:Microsoft Exchange Server 2010\x0d
Sep 7 10:31:44 roundcube php[41163]: VERSION:2.0\x0d
---snip---

This is with roundcube 1.6.2, php 8.1, the most recent roundcube_caldav release (tgz file, not git pull), and todays composer run.

Bye,
Alexander.

The ICal parser seems to be initialised the wrong way if you want to directly start from a string – instead of

$ics = $message->get_part_body($attachment->mime_id);
$ical = new ICal($ics);

I think you need to do

$ics = $message->get_part_body($attachment->mime_id);
$ical = new ICal();
$ical->initString($ics);

or if you also need to pass some options, then pass false for the file

$ical = new ICal(false, array('skipRecurrence' => true));
$ical->initString($ics_to_send);

That said, those modifications get rid of the errors in the log file, but the event display still remains stuck on the loading spinner, altough that's a different issue I guess.

Thanks @buttercookie42 and @netchild your help is highly appreciated!
Yes you're right the initialization of ICS file has been changed in the johngrogg/ics-parser plugin, so it doesn't work as it used to.

I've changed as you said and i hope there is no other breaking change I've forgotten.

@buttercookie42 I cannot reproduce your other issue when you're stuck on the loading spinner, don't hesitate to give me further information, or propose pull request if you find a correction.