• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Embedded media: Encoded characters in URLs not parsed properly

#1
Set up a BB Code Media Site for Google Calendar as follows:

Match URLs:
Code:
http*://www.google.com/calendar/embed?src={$id}
Embed HTML:
Code:
<iframe src="https://www.google.com/calendar/embed?mode=AGENDA&amp;height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src={$id}&amp;color=%23B1440E&amp" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>
The URL for the particular calendar I was testing it with includes an encoded "@" as %40:
Code:
https://www.google.com/calendar/embed?src=romtclpr1677emdmr1v4vpbl5k%40group.calendar.google.com&ctz=America/New_York
After the embed is processed, XF converts "%40" to "%2540" (%25 is the encoded version of %), leaving me with this:
Code:
<iframe src="https://www.google.com/calendar/embed?mode=AGENDA&amp;height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=romtclpr1677emdmr1v4vpbl5k%2540group.calendar.google.com&amp;color=%23B1440E&amp" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>
 
#2
Side note: I'm also not sure how to trim the "&ctz=America/New_York" off the end of the URL. Google will tack it onto the calendar URL whenever a user acquires it.
 

Mike

XenForo developer
Staff member
#3
I've fixed this now. I'm just urldecoding the ID that comes out of the URL (provided no callback is being used to process it). This can be worked around by manually tweaking the media tag that gets embedded to change the %40.

Also, the TZ portion of the URL will be ignored -- {$id} doesn't embed across "&" params.