aboutsummaryrefslogtreecommitdiff
path: root/video.module
diff options
context:
space:
mode:
authorLuke Last <lukelast@30151.no-reply.drupal.org>2005-09-11 20:13:59 +0000
committerLuke Last <lukelast@30151.no-reply.drupal.org>2005-09-11 20:13:59 +0000
commite458f77e73fc289e05e92a3f1ad1098e72a86e8a (patch)
tree08f55c5ea935963aa2c80a7d1f0b0d35c4e91eeb /video.module
parent7a54ef6c13a2424aa4a77c1bac74e2dc23737149 (diff)
downloadvideo-e458f77e73fc289e05e92a3f1ad1098e72a86e8a.tar.gz
video-e458f77e73fc289e05e92a3f1ad1098e72a86e8a.tar.bz2
Changed youtube video id's to be exactly 11 characters as confirmed by youtube.com's Brent Hurley
Diffstat (limited to 'video.module')
-rw-r--r--video.module4
1 files 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);