diff --git a/video_embed_field.handlers.inc b/video_embed_field.handlers.inc index dfeb860..9c41307 100644 --- a/video_embed_field.handlers.inc +++ b/video_embed_field.handlers.inc @@ -431,8 +431,17 @@ function video_embed_field_handler_youtube_form_validate($element, &$form_state, function _video_embed_field_get_vimeo_id($url) { $pos = strripos($url, '/'); if ($pos != FALSE) { - $pos += 1; - return (int) substr($url, $pos); + $matches = ""; + $vid_id = ""; + preg_match_all('!\d+!', $url, $matches); + foreach($matches as $i => $row) { + foreach($row as $b => $digits ) { + if(strlen($digits) >= 8) { + $vid_id = $digits; + } + } + } + return (int) $vid_id; } return FALSE; }