sureswiftcapital / WP-Google-Calendar-Events

Legacy version/fork of the Google Calendar Events 2.4 WordPress plugin. Intended for backwards compatibility only.
https://wordpress.org/plugins/legacy-google-calendar-events/
29 stars 18 forks source link

Parse Google Calendar Feed IDs with special url encoded % characters #49

Closed unfulvio closed 8 years ago

unfulvio commented 9 years ago

apparently they exist Calendar IDs with odd characters combinations (mostly % url encoded characters)

mostly are sports/public calendars pre-compiled by Google

see https://wordpress.org/support/topic/adding-public-calendar-from-googles-shared-calendars?replies=13#post-7358920

currently these are sanitized by the plugin but the problem is that even when passing them unsanitized to curl/wp_remote_get/Google API PHP, Google Calendar responds with 403

there seems something wrong in how Google displays the calendar Id in the Calendar Settings page, which probably doesn't match the actual Calendar id. Or maybe needs a different handling by the plugin to produce the right result?

unfulvio commented 9 years ago

@nickyoung87 any thoughts on this?

unfulvio commented 9 years ago

For example, Google has this calendar (ID from the settings page):

shef_10439_%2541ustralia%2B%2557estern%2B%2541ustralia%23sports%40group.v.calendar.google.com

but if I try to add it to the calendar feed settings, as of now in 2.x, it comes out formatted as:

shef_10439_Australia+Western+Australia%23sports@group.v.calendar.google.com

Whereas if opened manually from Google (from the Google Calendar page where the original calendar is), the URL appears formatted as:

shef_10439_%2541ustralia%2B%2557estern%2B%2541ustralia%23sports%40group.v.calendar.google.com

however, even leaving it unsanitized for test purposes, will not fetch a calendar

nickyoung87 commented 9 years ago

@nekojira Doesn't seem to be throwing a 403 in the refactor branch, or am I missing something?

unfulvio commented 9 years ago

do calendars like the one posted above work now and pull events?

nickyoung87 commented 9 years ago

@nekojira It was not pulling any events in (not sure if the calendar had any events so I would need to double check that), but it at least showed a grid view and did not show any error messages last I checked.