Number sign symbol (#) in event title breaks ics download

Created on 12 August 2022, over 2 years ago
Updated 9 February 2024, about 1 year ago

Problem/Motivation

If a node title or summary field contains a # symbol, the ics file is truncated after the #

Steps to reproduce

Create an event with a # symbol in the title. Download the 'outlook' ics file.

Proposed resolution

Add $field_value = str_replace('#', '', $field_value); to the parseField method, and set the strip_markup argument to TRUE for the $label variable.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mmarler

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    I've attached a patch that puts the title, location, and description -- the 3 fields that currently accept direct user input or tokens from the entity -- through rawurlencode, only for the iCal and Outlook outputs. The Google link should *not* be encoded in this fashion.

    The goal here is to ensure that any user input that contains characters that would cause the iCal content to be truncated, such as #, would be encoded. I tried to find something in the iCal spec about this but came up empty-handed.

    1. I did confirm that both the Outlook and iCal outputs pass validation at https://icalendar.org/validator.html
    2. I confirmed that the outputs could be imported into Outlook (MacOS) and "Calendar" (MacOS), as shown in the screenshots below:

    Setting this to needs review for input from others, especially mandclu, for corroboration that we should urlencode all three of these fields, that it should have no adverse effects on existing content (or any content, for that matter), and potentially to functionally test this on a Windows machine.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update over 1 year ago
    1 pass
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    I've put the latest proposed approach for handling this into the merge request, and targeting the 1.1.x branch now. Leaving as "Needs review."

  • Pipeline finished with Skipped
    about 1 year ago
    #82904
  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    After further thinking about this, I conclude that the truncation due to the presence of a # symbol is a significant -- and not user-intuitive -- problem, and we should proceed with encoding the output to avoid this problem.

    I've committed the merge request, which includes new test coverage.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024