From e458f77e73fc289e05e92a3f1ad1098e72a86e8a Mon Sep 17 00:00:00 2001 From: Luke Last Date: Sun, 11 Sep 2005 20:13:59 +0000 Subject: Changed youtube video id's to be exactly 11 characters as confirmed by youtube.com's Brent Hurley --- video.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video.module b/video.module index ac10642..0cfb20d 100644 --- a/video.module +++ b/video.module @@ -1008,8 +1008,8 @@ function theme_video_download(&$node) { * string value of file type or boolean FALSE on error */ function _video_get_filetype($vidfile) { - //If the filename doesn't contain a ".", "/", or "\" then consider it a youtube video ID. - if (!strpos($vidfile, '.') and !strpos($vidfile, '/') and !strpos($vidfile, '\\') and strlen($vidfile) <= 12 and strlen($vidfile) >= 10) { + //If the filename doesn't contain a ".", "/", or "\" and is exactly 11 characters then consider it a youtube video ID. + if (!strpos($vidfile, '.') and !strpos($vidfile, '/') and !strpos($vidfile, '\\') and strlen($vidfile) == 11) { $file_type = 'youtube'; } elseif (strstr($vidfile, '.')) { //If file contains a "." then get the file extension after the "." $file_type = substr($vidfile, strrpos($vidfile, '.') + 1); -- cgit v1.2.3