parser: support media:content elements within media:group

This commit is contained in:
Andrew Dolgov 2013-08-05 10:33:13 +04:00
parent f612dbe8a0
commit 4289b68f0d
2 changed files with 24 additions and 0 deletions

View file

@ -149,6 +149,18 @@ class FeedItem_Atom extends FeedItem_Common {
array_push($encs, $enc); 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; return $encs;
} }

View file

@ -124,6 +124,18 @@ class FeedItem_RSS extends FeedItem_Common {
array_push($encs, $enc); 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; return $encs;
} }