X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;f=ItemAddEmbedVideo.inc;h=bbb941d3a6562f6d652a62af5ef336cd66f8f6a4;hb=ebec4ad4f9051c9101dfb1ff331ea5a1a1832094;hp=d598ee2c1d09dd501eff2dd03430aa8a0eaa4f07;hpb=46e1538c4e6375a1cc5b5a84c339777df1dc69a0;p=embedvideo%2F.git diff --git a/ItemAddEmbedVideo.inc b/ItemAddEmbedVideo.inc index d598ee2..bbb941d 100644 --- a/ItemAddEmbedVideo.inc +++ b/ItemAddEmbedVideo.inc @@ -175,8 +175,12 @@ class ItemAddEmbedVideo extends ItemAddPlugin { $unsupported_url=0; /* Store the passed URL in a shorter local variable */ + /* Strip trailing whitespace in the url, this will cause problems later */ $url = $form['webPage']['URL']; - + if(preg_match("/(.*?)\s+/",$url,$matches)) { + $url = $matches[1]; + } + /* ***************************** * Embed a Youtube Video @@ -331,7 +335,7 @@ class ItemAddEmbedVideo extends ItemAddPlugin { } /* Extract the thumbnail URL from the webpage contents */ - preg_match('/thumbnail: \'(http:\/\/.*?\/ThumbnailServer2.+?)\'/i', + preg_match('/\'(http:\/\/.*?\/ThumbnailServer2.+?)\'/i', $contents, $matches); $thumbnail=$matches[1]; $thumbnail=preg_replace("/\\\\x26/","&",$thumbnail); @@ -798,18 +802,19 @@ class ItemAddEmbedVideo extends ItemAddPlugin { } /* Format the description to hold a reference to the embedded video */ - $description = ''; $description.= ''; - $description.= ''; - $description.= ''; - $description.= ''; - + $description.= ''; + $description.= ''; + $description.= ''; + $description.= ''; + /* ********************************** * Embed a remote .swf file