]> git.wh0rd.org Git - tt-rss.git/commitdiff
parser: support media:content elements within media:group
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 5 Aug 2013 06:33:13 +0000 (10:33 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 5 Aug 2013 06:33:13 +0000 (10:33 +0400)
classes/feeditem/atom.php
classes/feeditem/rss.php

index 8a21d6142fc2e0e0f9bac69946c1fa96258e2e38..e88b5ec1ddfbaa4a8bff23af4e0bf681a5536f4e 100644 (file)
@@ -149,6 +149,18 @@ class FeedItem_Atom extends FeedItem_Common {
                        array_push($encs, $enc);
                }
 
+               $enclosures = $this->xpath->query("media:group/media:content", $this->elem);
+
+               foreach ($enclosures as $enclosure) {
+                       $enc = new FeedEnclosure();
+
+                       $enc->type = $enclosure->getAttribute("type");
+                       $enc->link = $enclosure->getAttribute("url");
+                       $enc->length = $enclosure->getAttribute("length");
+
+                       array_push($encs, $enc);
+               }
+
                return $encs;
        }
 
index e5960243cf2b723195981bae471d38a5cd9b66c4..a2e9f01a27c81a4776b56f28320c692e3a5fe57d 100644 (file)
@@ -124,6 +124,18 @@ class FeedItem_RSS extends FeedItem_Common {
                        array_push($encs, $enc);
                }
 
+               $enclosures = $this->xpath->query("media:group/media:content", $this->elem);
+
+               foreach ($enclosures as $enclosure) {
+                       $enc = new FeedEnclosure();
+
+                       $enc->type = $enclosure->getAttribute("type");
+                       $enc->link = $enclosure->getAttribute("url");
+                       $enc->length = $enclosure->getAttribute("length");
+
+                       array_push($encs, $enc);
+               }
+
                return $encs;
        }