Browse Source

bug fix: url youtube mal formé non supproté par video_embed

bastien 13 years ago
parent
commit
7756554a35
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/Muzich/CoreBundle/ElementFactory/lib/VideoEmbed.php

+ 5 - 3
src/Muzich/CoreBundle/ElementFactory/lib/VideoEmbed.php View File

@@ -235,9 +235,11 @@ class VideoEmbed {
235 235
         if (($this->_type)) {
236 236
             $regexp = $this->_video_embed_conf['services'][$this->_type]['extractPattern'];
237 237
             preg_match($regexp, $this->_embedSource , $match);
238
-
239
-            if ($match[count($match)-1]) $this->_id = $match[count($match)-1];
240
-            return $this->_id;
238
+            if (count($match))
239
+            {
240
+              if ($match[count($match)-1]) $this->_id = $match[count($match)-1];
241
+              return $this->_id;
242
+            }
241 243
         }
242 244
         return false;
243 245
     }