summaryrefslogtreecommitdiff
path: root/classes/feeditem
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-08-05 11:50:15 +0400
committerAndrew Dolgov <[email protected]>2013-08-05 11:50:15 +0400
commit6bf61bdc639f60957ce4edc9e0160de3e78dc7df (patch)
treee81f7d1292691bd7be0919e7a52126e8d8a2a25f /classes/feeditem
parent4289b68f0d4e4bcf5e9c09cf03367be3e638ccba (diff)
simplify media:content xpath
Diffstat (limited to 'classes/feeditem')
-rw-r--r--classes/feeditem/atom.php14
-rw-r--r--classes/feeditem/rss.php14
2 files changed, 2 insertions, 26 deletions
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php
index e88b5ec1d..b1251e6d3 100644
--- a/classes/feeditem/atom.php
+++ b/classes/feeditem/atom.php
@@ -137,19 +137,7 @@ class FeedItem_Atom extends FeedItem_Common {
}
}
- $enclosures = $this->xpath->query("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);
- }
-
- $enclosures = $this->xpath->query("media:group/media:content", $this->elem);
+ $enclosures = $this->xpath->query("media:content | media:group/media:content", $this->elem);
foreach ($enclosures as $enclosure) {
$enc = new FeedEnclosure();
diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php
index a2e9f01a2..095225a2a 100644
--- a/classes/feeditem/rss.php
+++ b/classes/feeditem/rss.php
@@ -112,19 +112,7 @@ class FeedItem_RSS extends FeedItem_Common {
array_push($encs, $enc);
}
- $enclosures = $this->xpath->query("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);
- }
-
- $enclosures = $this->xpath->query("media:group/media:content", $this->elem);
+ $enclosures = $this->xpath->query("media:content | media:group/media:content", $this->elem);
foreach ($enclosures as $enclosure) {
$enc = new FeedEnclosure();