[Import] Outlook type of UIDs breaks import
Hey,
I've just had some issues with an ICS import file from one of our customers. The file is generated by MS Outlook (:disappointed_face:) and has UIDs like this:
UID:AAAAAHtOv3wxJthOgg7RDHt43X/k4iQA
UID:AAAAAHtOv3wxJthOgg7RDHt43X+E4iQA
UID:AAAAAHtOv3wxJthOgg7RDHt43X/E4iQA
(Seems the've never heard of the RFCs...)
The latter two lead to an exception in the import_calendar_collection
from caldav-PUT-functions.php
as the special characters &?\\/@%+:
get stripped from the UID and result in the same dav_name
. A database exception than stops the import. I don't want to use skip_bad_event_on_import
as the events aren't that bad.
I suggest to compare the stripped UID with the original and just add some magic dust if it differs. An alternate approach would be to replace the UID with a uuid()
. You'd also could do a query to checkup the UID, but this would seriously slow down the import.
Cheers Matthias