Added code to strip trailing whitespace off URL, which causes issues
authorAlan J. Pippin <ajp@pippins.net>
Sun, 1 Feb 2009 20:58:06 +0000 (13:58 -0700)
committerAlan J. Pippin <ajp@pippins.net>
Sun, 1 Feb 2009 20:58:06 +0000 (13:58 -0700)
when actually embedding the video.

ItemAddEmbedVideo.inc

index bfb8daab44028f339ca27a5d45fcf621bc1b8829..bbb941d3a6562f6d652a62af5ef336cd66f8f6a4 100644 (file)
@@ -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