Invalid iCal File due to encoding

Home Forums Calendar Products Events Calendar PRO Invalid iCal File due to encoding

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #960745
    Daniel
    Participant

    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.

    #960889
    Jami
    Blocked

    Hi 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,
    Jami

    #961040
    Daniel
    Participant

    Hi 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,

    #961616
    Jami
    Blocked

    Hi 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,
    Jami

    #961852
    Jami
    Blocked

    Hi 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,
    Jami

    #962050
    Daniel
    Participant

    This reply is private.

    #962177
    Jami
    Blocked

    Thanks 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,
    Jami

    #962274
    Daniel
    Participant

    Cool, 🙂

    just keep me posted.

    kind regards,
    daniel

    #962723
    Jami
    Blocked

    Thanks Daniel! If you have any other questions, please feel free to open up a new thread.

    Kind Regards,
    Jami

    #964318
    Brian
    Keymaster

    Just 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

    #988010
    Leah
    Member

    Hello,

    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

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Invalid iCal File due to encoding’ is closed to new replies.