From: Alan J. Pippin Date: Sun, 1 Feb 2009 20:58:06 +0000 (-0700) Subject: Added code to strip trailing whitespace off URL, which causes issues X-Git-Tag: 1_1_3~1 X-Git-Url: http://git.pippins.net/embedvideo/static/%27%20%20%20%20.%20%24GLOBALS%5B%27phpgw%27%5D-%3Elink%28%27inc/jquery/images/.%24link.?a=commitdiff_plain;h=ebec4ad4f9051c9101dfb1ff331ea5a1a1832094;p=embedvideo%2F.git Added code to strip trailing whitespace off URL, which causes issues when actually embedding the video. --- 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