Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,16 +360,17 @@ function build_embed_youtube($url, $width = NULL, $height = NULL, $params)
}

function is_vimeo($url) {
return preg_match("/^\s*https?:\/\/vimeo\.com\/[0-9]+/", $url);
return preg_match("/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/", $url);
}

function parse_vimeo($url) {
$parsed = parse_url($url);
$key = substr($parsed['path'], 1);
$key = explode("/", $parsed['path']);
$key = explode("?", end($key));

return array(
'service' => 'vimeo',
'key' => $key
'key' => $key[0]
);
}

Expand Down
6 changes: 3 additions & 3 deletions themes/third_party/videolink/js/videolink.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jQuery(function($) {
var vimeo = {
name: 'Vimeo',
getCode: function(url) {
var parse = url.match(/https?:\/\/vimeo.com\/([0-9]+)/);
if (parse && parse[1]) {
return parse[1];
var parse = url.match(/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/);
if (parse && parse[parse.length-1]) {
return parse[parse.length-1];
}
},
getData: function(code, callback) {
Expand Down