Home › Forums › Calendar Products › Events Calendar PRO › Invalid iCal File due to encoding
- This topic has 10 replies, 4 voices, and was last updated 8 years, 9 months ago by Leah.
-
AuthorPosts
-
May 6, 2015 at 4:34 am #960745DanielParticipant
Hey,
i just noticed that my exported ical-files are all currupted, neither Apples iCal nor Google Calendar accept my exports recently.
After quite some digging i found that the organizers data (and it’s encoding) causes this since some organizers have special characters in its title which get escaped within the tribe_get_organizer function via
esc_html()
.i decided to use this fix for now:
add_filter( 'tribe_ical_feed_item', 'fix_tribe_ical', 10, 2 ); function fix_tribe_ical( $item, $event_id ) { $searchValue = "ORGANIZER;CN"; $fl_array = preg_grep( '/^' . "$searchValue" . '.*/', $item ); $keynum = key( $fl_array ); if( !empty($fl_array) AND isset($item[ $keynum ]) ) { $item[ $keynum ] = html_entity_decode($item[ $keynum ], ENT_COMPAT, 'UTF-8'); } return $item; }
Please fix this because this issue is able to completey break the ical export functionality.
May 6, 2015 at 10:23 am #960889JamiBlockedHi Daniel,
Thanks for getting in touch with us about this. The esc_html function is an important part of data validation and its purpose is to escape (or remove) HTML string that may cause some issues down stream. The organizer data being escaped with esc_html should be their email, name, url, and phone number.
I’m curious to know a few more details about the special characters that are required for your organizers. Do you mind giving me an example of what shouldn’t be getting filtered out?
Look forward to hearing back from you.
Kind Regards,
JamiMay 7, 2015 at 12:55 am #961040DanielParticipantHi Jami,
i understand the need for html escaping but it renders the ical-file completely unusable in my case.
so, if only one invalid character is included, the whole ical feed won’t be readable by calendar apps.
that’s what i experienced here.only one char messed things up here: “–” which results in this HTML-entity: – (encoded by esc_html())
i’d say don’t escape organizer’s data for the ical-format.
regards,
May 9, 2015 at 9:42 am #961616JamiBlockedHi Daniel,
Thanks for your feedback about this. I’m going to look into this a little further and see if I can sort out the reason for it. I think it’s quite common for a dash to be inserted into a phone number, for example, and I don’t believe that should affect the way that the events are importing.
I appreciate your patience while I investigate. I’ll keep you posted!
Kind Regards,
JamiMay 11, 2015 at 10:22 am #961852JamiBlockedHi Daniel,
Thanks so much again for reporting this and for your patience. I’m trying to reproduce the error you’re getting but I’ve been unsuccessful so far. I’m wondering if you could link to one of your events for one of your organizers that has special characters in the data. I’d like to try the same ical export that you have.
I look forward to hearing back from you.
Kind Regards,
JamiMay 12, 2015 at 1:05 am #962050DanielParticipantThis reply is private.
May 12, 2015 at 12:24 pm #962177JamiBlockedThanks Daniel! We’ve got our eyes on getting this updated in a future release. I don’t have an exact time frame for you quite yet though. I’m going to make a note to follow up with you here once I have more info about it.
I’m happy you’ve found a work around for the time being and thanks again for all your help and for reporting the issue! Thanks so much for your patience.
Kind Regards,
JamiMay 12, 2015 at 11:55 pm #962274DanielParticipantCool, 🙂
just keep me posted.
kind regards,
danielMay 14, 2015 at 1:43 pm #962723JamiBlockedThanks Daniel! If you have any other questions, please feel free to open up a new thread.
Kind Regards,
JamiMay 21, 2015 at 1:48 pm #964318BrianKeymasterJust following up here, you thread is on our ticket and one of our team members will update it once we have a release.
For now there is nothing more to do so I am going to close the thread.
Feel free to create a new thread and reference this one to save you time if you have new questions or issues.
Thanks
July 20, 2015 at 12:22 pm #988010LeahMemberHello,
Thank you again for bringing this issue to our attention. We’re happy to say that we have added a fix for this into our upcoming version 3.11 release. Keep an eye on your Updates page for the new version. If you have any trouble with the update (or are still seeing this problem after you update) please start a new thread and we’d be happy to help out.
Thank you for your patience while we got this release ready to go!
Best,
Leah
and the rest of The Events Calendar team -
AuthorPosts
- The topic ‘Invalid iCal File due to encoding’ is closed to new replies.