Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to import ical files into version 1.3 with php7.2.5 until making these changes #109

Closed
pszaban opened this issue Oct 1, 2018 · 1 comment

Comments

@pszaban
Copy link

pszaban commented Oct 1, 2018

FYI: I was unable to import Microsoft ical email attachment. Apache error log showed:

PHP Fatal error: Uncaught Error: Cannot use assign-op operators with st
ring offsets in .../WebCalendar/includes/xcal.php:2224\nStack trace:\n#0 .../WebCalendar/import_handler.php(84): parse_ical('/tmp/phpMAlCkg')\n#1 {main}\n thrown in .../WebCalendar/includes/xcal.php on line 2224, referer: https://.../WebCalendar/import.php

I didn't study the code closely, but "fixed" the problem with a couple simple changes...

--- xcal.php    2018-10-01 10:05:27.796000000 -0400
+++ xcal.php.new        2018-10-01 10:05:15.632000000 -0400
@@ -2006,7 +2006,7 @@
   $subsubstate = ''; // reflect the sub-sub section
   $error = false;
   $line = 0;
-  $event = '';
+  $event = array();
   $lines = explode ( "\n", $data );
   $linecnt = count ( $lines );
   for ( $n = 0; $n < $linecnt && ! $error; $n++ ) {
@@ -2164,14 +2164,14 @@
         $substate = 'none';
         $subsubstate = '';
         // clear out data for new event
-        $event = '';
+        $event = array();
       } elseif ( preg_match ( "/^END:VTODO$/i", $buff, $match ) ) {
         if ( $tmp_data = format_ical ( $event ) ) $ical_data[] = $tmp_data;
         $state = 'VCALENDAR';
         $substate = 'none';
         $subsubstate = '';
         // clear out data for new event
-        $event = '';
+        $event = array();
         // folded lines?, this shouldn't happen
       } elseif ( preg_match ( '/^\s(\S.*)$/', $buff, $match ) ) {
         if ( $substate != 'none' ) {
@@ -2231,7 +2231,7 @@
          $state = 'VCALENDAR';
          $substate = 'none';
          $subsubstate = '';
-         $event = '';
+         $event = array();
        } elseif ( preg_match ( '/^ORGANIZER.*:(.+)$/i', $buff, $match ) ) {
          $substate = 'organizer';
          $event[$substate] = $match[1];

This was with webcalendar 1.3 and SuSE LEAP 15.0 using php 7.2.5 and kernel 4.12.14-lp150.12.16-default
Feel free to close/ignore/delete/whatever this issue, I just reported it in hopes of helping someone else who may encounter the same problem.

@craigk5n
Copy link
Owner

Fixed with commit d00f980, which is almost identical to the code changes here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants