1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 03:15:56 +00:00

parser: fix failing on empty media:group tags

This commit is contained in:
Andrew Dolgov
2014-01-12 08:53:30 +04:00
parent de0d8d1088
commit 2ab7ccb695
2 changed files with 26 additions and 22 deletions

View File

@@ -160,6 +160,7 @@ class FeedItem_Atom extends FeedItem_Common {
$content = $this->xpath->query("media:content", $enclosure)->item(0);
if ($content) {
$enc->type = $content->getAttribute("type");
$enc->link = $content->getAttribute("url");
$enc->length = $content->getAttribute("length");
@@ -174,6 +175,7 @@ class FeedItem_Atom extends FeedItem_Common {
array_push($encs, $enc);
}
}
$enclosures = $this->xpath->query("media:thumbnail", $this->elem);

View File

@@ -140,6 +140,7 @@ class FeedItem_RSS extends FeedItem_Common {
$content = $this->xpath->query("media:content", $enclosure)->item(0);
if ($content) {
$enc->type = $content->getAttribute("type");
$enc->link = $content->getAttribute("url");
$enc->length = $content->getAttribute("length");
@@ -154,6 +155,7 @@ class FeedItem_RSS extends FeedItem_Common {
array_push($encs, $enc);
}
}
$enclosures = $this->xpath->query("media:thumbnail", $this->elem);