dreamwidth/dw-free — pull request #470 by rickscott (2013-07-01 04:58:57+00:00)
Title: (bug 5149) allow network-rel URLs in YT embeds

http://bugs.dwscoalition.org/show_bug.cgi?id=5149

Youtube has started using network-relative URLs in its embed codes, eg
src="//www.youtube.com/...". This is a legit but uncommon syntax --
it means "fetch this location, using the same protocol as you used for
this page" -- eg http for http, https for https.

This patch updates the allow_iframe_embeds hook to permit URLs of this
form. Unfortunately, the URI module can't cope with them, so we have
to lie to it about the URL scheme to get the rest of its parsing to
work. We don't modify the URL that's actually used to do the
embedding, though -- just what's used for checks inside the hook.