example:

http://www.youtube.com/watch?v=PbWULu5_nXI

above video fails to be embedded when using

[youtube]PbWULu5_nXI[/youtube]

It seems the problem is on line 194 of bbcode-filter.inc. It appears the regex is not even looking out for underscores in the ID. A simple tweak to the regex should have it sorted

Change Line 194 to add _ in regex:

'#\[youtube\]([0-9a-zA-Z]+)

to

'#\[youtube\]([0-9a-zA-Z_]+)

eg:

    '#\[youtube\]([0-9a-zA-Z_]+)\[/youtube\]#si' => '<object width="425" height="366"><param name="movie" value="http://www.youtube.com/v/\\1"></param><embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" width="425" height="366"></embed></object>',

Cheers
J

Comments

naudefj’s picture

Version: 5.x-2.1 » 6.x-1.2
Priority: Normal » Minor
Status: Active » Fixed

Hi,

Problem is already fixed in Drupal 6's BBcode module.

You can apply the fix to your local installation or upgrade to Drupal 6.

Best regards.

Frank

dakku’s picture

cheers for the reply Frank, D6 upgrade is in the pipeline but for now the work sites are still D5 due to a LOT of custom modules. These will obviously take some time!

I havent tried the D6 branch, but thought the code above would help anyone in the same boat as me. Maybe it should be rolled into any future D5 updates too?

Status: Fixed » Closed (fixed)

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

dakku’s picture

anyone still using D5 brand will notice that videos containing - doesnt work either. change the above line to:

'#\[youtube\]([0-9a-zA-Z-_]+)\[/youtube\]#si' => '<object width="425" height="366"><param name="movie" value="http://www.youtube.com/v/\\1"></param><embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" width="425" height="366"></embed></object>',