simplify media:content xpath

This commit is contained in:
Andrew Dolgov 2013-08-05 11:50:15 +04:00
parent 4289b68f0d
commit 6bf61bdc63
2 changed files with 2 additions and 26 deletions

View file

@ -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();

View file

@ -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();