I have an rss feed for news articles. The articles contain embedded YouTube videos using the Media and Media: YouTube modules. The description element is set as the body of the content, which contain the youtube iframe embeds.

With the "Replace relative paths with absolute URLs" disabled, the videos are correctly viewable using the feed. If this option is enabled, the src attribute of the iframe is rewritten, improperly placing the absolute path of the site in front of the path. This is because the src attribute contains "//www.youtube.com/..." without http or https to allow for either ssl or non-ssl links, depending on the current context of the page.

I think the solution is to edit the regular expression to allow for paths like these to be accepted as absolute, but I'm not sure of the modifications needed to the regex.

For example:
<iframe class="media-youtube-player" width="570" height="347" title="&quot;We're Too Famous&quot; Official Music Video" src="//www.youtube.com/embed/zDhSItfjlZ8?wmode=opaque&amp;modestbranding=1&amp;rel=0" frameborder="0" allowfullscreen="">Video of &amp;quot;We&amp;#039;re Too Famous&amp;quot; Official Music Video</iframe>

becomes:
<iframe class="media-youtube-player" width="570" height="347" title="&quot;We're Too Famous&quot; Official Music Video" src="http://www.fanlala.com//www.youtube.com/embed/zDhSItfjlZ8?wmode=opaque&amp;modestbranding=1&amp;rel=0" frameborder="0" allowfullscreen="">Video of &amp;quot;We&amp;#039;re Too Famous&amp;quot; Official Music Video</iframe>

Comments

bropp’s picture

For now, I have worked around the issue by requiring all of my youtube embeds to use https exclusively.

maciej.zgadzaj’s picture

Status: Active » Fixed

Solution proposed by logicalor in #1832794: Regular Expression for matching relative paths breaks Google Adwords Remarketing javascript (and others) applied and pushed to 7.x-2.x-dev and 6.x-2.x-dev on d.o.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

typo fix