Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-71556

iCal library issue: CAL_ADDRESS is malformed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.10.3, 3.11, 4.0
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE

      Description

      This bug does not affect Moodle as we don't use iCal that way in core.

      The issue is with Bennu ical library we use. When I add property that expects CAL_ADDRESS as value (such as ATTENDEE or ORGANIZER), it is extra quoted. e.g. code:

              $ev->add_property('attendee', 'MAILTO:' . $user->email, [
                  'ROLE' =>'REQ-PARTICIPANT',
                  'PARTSTAT' => 'ACCEPTED',
                  'RSVP' => 'FALSE',
                  'CN' => fullname($user),
                  'CUTYPE' => 'INDIVIDUAL',
                  'LANGUAGE' => $user->lang,
              ]);
      

      produces an output similar to:

      ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=FALSE;CN="Admin User";
      	CUTYPE=INDIVIDUAL;LANGUAGE=EN:"MAILTO:qqq@aaa.com"
      

      Outlook (Office 2016) is sensitive to this (won't add event), Google calendar is not (adds event OK). The spec suggests there should be no quotes wrapping MAILTO: https://www.kanzaki.com/docs/ical/attendee.html#example, i.e.

      ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=FALSE;CN="Admin User";
      	CUTYPE=INDIVIDUAL;LANGUAGE=EN:MAILTO:qqq@aaa.com
      

      When modified this way, ical is imported to outlook with no issues. Two example events are attached for local testing (one unmodified, another one is fixed).

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            kabalin Ruslan Kabalin
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: