vanillaforums/Garden — Issue #1293: YouTube links aren't always translated.
Author: Shmizzle
Created: 2012-01-19 04:57:46+00:00
State: open

If "v" isn't the first variable in the YouTube link that's pasted on a forum, it doesn't get translated/transformed into the embed code. For example, http://www.youtube.com/watch?v=hGLZqDXau98&feature=fvwp&NR=1 will get translated, but http://www.youtube.com/watch?feature=fvwp&NR=1&v=hGLZqDXau98 will not.

Looks like it should be a "simple" fix in library/core/class.format.php, modifying this line:

if ((preg_match('`(?:https?|ftp)://www\.youtube\.com\/watch\?v=([^&]+)`', $Url, $Matches)

I suck at regex though so I'll leave it to someone who doesn't suck at it.