HTML entities in iCalendar export
Overview
iCalendar (iCal) export does not decode html entities.
Reproduction steps
- Create an event or activity with a html description containing special characters like German umlauts or non breaking spaces.
- Export this entity as ical and open it in a mail client like Microsoft Outlook.
- Note that text contains html entities like
ü
or&npsp;
Current behaviour
Example excerpt from iCalendar export:
DESCRIPTION:Ein Thema der Fachveranstaltung ist die Digitalisi
erung im Bereich der Agrarwirtschaft\, unter ander
em \;wie die Messung und Speicherung von Daten
 \;landwirtschaftlich genutzt werden kö\;n
nen.\n \n Die Teilnehmer kö\;nnen aschlie&szli
g\;end \;innerhalb von Workshops zum Thema Bio
gasanlage und Energieeffizienz ihr Wissen erweiter
n.
Expected behaviour
Decode all html entities for safe iCalendar use.
Environment information
- CiviCRM: Master
- PHP: 7.2
- CMS: Drupal 7.30
Comments
This issue was already reported in https://issues.civicrm.org/jira/browse/CRM-13645 Based on this I've created a patch, which fixes the issue for me: ical_htmlentitydecode.patch
Note that html in iCalendar is fine if the "Alternate Text Representation" points to a "text/html" content portion (see https://tools.ietf.org/html/rfc5545#section-3.2.1 for details).
Edited by Philipp Michael