pulsejet / banner-ics

Show calendar event banner from iCalendar attachments in Roundcube
https://packagist.org/packages/radialapps/banner-ics
MIT License
6 stars 5 forks source link

Undefined property: ICal\Event::$attendee_array // Uncaught TypeError: array_merge(): Argument #2 must be of type array #12

Closed emtiu closed 1 year ago

emtiu commented 1 year ago

Hi, and thanks for your great work on this plugin :)

About 10–20% of the .ics-attached email messages I receive will throw the following error. It is fatal, meaning the message cannot be displayed unless I disable the plugin in Roundcube's config.

Here's the log output I'm seeing when the error occurs. The PHP version is 8.1.

PHP Deprecated:  auto_detect_line_endings is deprecated in /usr/home/xxx/Roundcube/vendor/johngrogg/ics-parser/src/ICal/ICal.php on line 500
PHP Warning:  Undefined property: ICal\Event::$attendee_array in /usr/home/xxx/Roundcube/plugins/banner_ics/banner_ics.php on line 85
PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /usr/home/xxx/Roundcube/plugins/banner_ics/banner_ics.php:85
Stack trace:
#0 /usr/home/xxx/Roundcube/plugins/banner_ics/banner_ics.php(85): array_merge()
#1 /usr/home/xxx/Roundcube/plugins/banner_ics/banner_ics.php(43): banner_ics->process_attachment()
#2 /usr/home/xxx/Roundcube/program/lib/Roundcube/rcube_plugin_api.php(520): banner_ics->ics_banner()
#3 /usr/home/xxx/Roundcube/program/actions/mail/show.php(369): rcube_plugin_api->exec_hook()
#4 /usr/home/xxx/Roundcube/program/include/rcmail_output_html.php(1484): rcmail_action_mail_show::message_objects()
#5 [internal function]: rcmail_output_html->xml_command()
#6 /usr/home/xxx/Roundcube/program/include/rcmail_output_html.php(1322): preg_replace_callback()
#7 /usr/home/xxx/Roundcube/program/include/rcmail_output_html.php(825): rcmail_output_html->parse_xml()
#8 /usr/home/xxx/Roundcube/program/include/rcmail_output_html.php(654): rcmail_output_html->parse()
#9 /usr/home/xxx/Roundcube/program/actions/mail/show.php(164): rcmail_output_html->send()
#10 /usr/home/xxx/Roundcube/program/include/rcmail.php(282): rcmail_action_mail_show->run()
#11 /usr/home/xxx/Roundcube/index.php(278): rcmail->action_handler()
#12 /usr/home/xxx/Roundcube/public_html/index.php(26): include('/usr/home/xx...')
#13 {main}
  thrown in /usr/home/xxx/Roundcube/plugins/banner_ics/banner_ics.php on line 85

I'm attaching the source of one email message that triggers this bug for me. I've shortened it substantially for anonymization, but it still behaves the same when loaded in Roundcube: testmail.txt

Let me know if this helps you reproduce the bug. Otherwise, I can go hunt for more example messages.

pulsejet commented 1 year ago

Try v1.3.2

emtiu commented 1 year ago

Yes, updating to 1.3.2 did the trick! Until https://github.com/pulsejet/banner-ics/commit/36bacac7c0e14d904d8959db036fb08c33f6be8a, phar wouldn't pick up the update, but now it did. Thanks a lot :)