Commit efd7ed76 authored by Francois Marier's avatar Francois Marier
Browse files

externalvideo block: allow youtube iframe-style embbed code



Thanks to Mike Kelly for the regexp!

Bug #708327
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent f2ed25a2
......@@ -159,11 +159,16 @@ class PluginBlocktypeExternalvideo extends SystemBlocktype {
private static function make_video_url($url) {
static $embedsources = array(
// www.youtube.com
// www.youtube.com (old style)
array(
'match' => '#.*youtube\.com.*(v|(cp))(=|\/)([a-zA-Z0-9_=-]+).*#',
'url' => 'http://www.youtube.com/$1/$4'
),
// www.youtube.com (iframe)
array(
'match' => '#.*youtube\.com.*(embed\/)([a-zA-Z0-9_=-]+).*#',
'url' => 'http://www.youtube.com/v/$2'
),
// video.google.com
array(
'match' => '#.*video.google.com.*docid=(\-?[0-9]+).*#',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment