From 4289b68f0d4e4bcf5e9c09cf03367be3e638ccba Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 5 Aug 2013 10:33:13 +0400 Subject: [PATCH] parser: support media:content elements within media:group --- classes/feeditem/atom.php | 12 ++++++++++++ classes/feeditem/rss.php | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index 8a21d614..e88b5ec1 100644 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -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; } diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index e5960243..a2e9f01a 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -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; } -- 2.39.5