X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=ItemAddEmbedVideo.inc;h=bbb941d3a6562f6d652a62af5ef336cd66f8f6a4;hb=ebec4ad4f9051c9101dfb1ff331ea5a1a1832094;hp=bfb8daab44028f339ca27a5d45fcf621bc1b8829;hpb=f7553a85847b1a40cf9d348ebbc2d27956fa8ac1;p=embedvideo%2F.git diff --git a/ItemAddEmbedVideo.inc b/ItemAddEmbedVideo.inc index bfb8daa..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