dakboard / Cloud-Platform

Feature requests, enhancements and anything you'd like to see in DAKboard!
https://dakboard.com
168 stars 39 forks source link

ICS Calendar Locations with links are displaying incorrectly #2113

Closed Dan-Peck closed 5 months ago

Dan-Peck commented 6 months ago

Summary

ICS Calendar Locations are rendering links as text in the calendar block.

Ref: 58517

Issue

Incorrect ICS Parsing of fields with ALTREP containing a colon.

When an ICS calendar file is parsed and has a line such as:

LOCATION;ALTREP="http://some.site.here/?q=Some+Params+Here":Some Field Value Here

This used to result in a LOCATION value of Some Field Value Here, however, now it results in //some.site.here/?q=Some+Params+Here":Some Field Value Here.

This was caused by a different, recent bugfix to adjust some complex regular expression strings to account for multi-line quoted values that have their closing-quote appear on a following line.

We will need to re-evaluate the regular expressions in order to account for both situations properly.

Regex before:

(.*?)(?::(?=(?:[^"]*"[^"]*")*[^"]*$)|;(?=[^:]*$))([\w\W]*)

Regex after:

(.*?)(?::(?=(?:[^"]*"[^"]*"?)*[^"]*$)|;(?=[^:]*$))([\w\W]*)

Workaround

Until this issue is addressed, a potential workaround to display the Location fields of such ICS calendar events properly is to:

Dan-Peck commented 5 months ago

The code has been modified such that the closing-quote regex for the multi-line field content is now only used as a fallback when no matches are found from the original regex. This will allow coverage for both scenarios.

This fix is currently in testing.

Dan-Peck commented 5 months ago

Merged in @ e7e7086 and added to the queue for upcoming release to the live site.