]> git.wh0rd.org Git - tt-rss.git/commitdiff
properly import multiple media-tag enclosures in feeds (magpie)
authorAndrew Dolgov <fox@madoka.spb.ru>
Sat, 25 Oct 2008 02:03:37 +0000 (03:03 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Sat, 25 Oct 2008 02:03:37 +0000 (03:03 +0100)
functions.php

index f9c78bee3e1c78580cd505d071debdb717a7ead1..f32d85af9dd354f36601b5672bc00bd036a078f1 100644 (file)
                                        }
 
                                        // <media:content>
-                                       // can there be many of those? -fox
+                                       // can there be many of those? yes -fox
 
                                        $m_ctr = $item['media']['content#'];
 
                                                        $item['media']['content@length']);
 
                                                array_push($enclosures, $e_item);
-                                       }
 
-                                       // FIXME: parse more of those, if needed.
+                                               for ($i = 0; $i <= $m_ctr; $i++ ) {
+
+                                                       if ($item["media"]["content#$i@url"]) {
+                                                               $e_item = array($item["media"]["content#$i@url"],
+                                                                       $item["media"]["content#$i@medium"],
+                                                                       $item["media"]["content#$i@length"]);
+                                                               array_push($enclosures, $e_item);
+                                                       }
+                                               }
+
+                                       }
                                }
 
                                # sanitize content