Ver código fonte

Anomalie #454: Vidéos youtube non prises en charge

Sevajol Bastien 11 anos atrás
pai
commit
b943e2322a

+ 6 - 3
src/Muzich/CoreBundle/Entity/Element.php Ver arquivo

@@ -724,11 +724,14 @@ class Element
724 724
   
725 725
   public function hasFavoriteUser($user_id)
726 726
   {
727
-    foreach ($this->elements_favorites as $favorite)
727
+    if (count($this->elements_favorites))
728 728
     {
729
-      if ($favorite->getUser()->getId() == $user_id)
729
+      foreach ($this->elements_favorites as $favorite)
730 730
       {
731
-        return true;
731
+        if ($favorite->getUser()->getId() == $user_id)
732
+        {
733
+          return true;
734
+        }
732 735
       }
733 736
     }
734 737
     

+ 1 - 1
src/Muzich/CoreBundle/Managers/ElementManager.php Ver arquivo

@@ -101,7 +101,7 @@ class ElementManager
101 101
     // On ne prend pas de risque avec le www, on l'enlève
102 102
     $url = str_replace('www.', '', $this->element->getUrl());
103 103
     
104
-    preg_match("/^(http:\/\/)?([^\/]+)/i", $url, $chaines);
104
+    preg_match("/^(http:\/\/|https:\/\/)?([^\/]+)/i", $url, $chaines);
105 105
     
106 106
     $type = 'unknow';
107 107
     if (array_key_exists(2, $chaines))