mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 08:35:56 +00:00
parser: fix failing on empty media:group tags
This commit is contained in:
@@ -160,6 +160,7 @@ class FeedItem_Atom extends FeedItem_Common {
|
|||||||
|
|
||||||
$content = $this->xpath->query("media:content", $enclosure)->item(0);
|
$content = $this->xpath->query("media:content", $enclosure)->item(0);
|
||||||
|
|
||||||
|
if ($content) {
|
||||||
$enc->type = $content->getAttribute("type");
|
$enc->type = $content->getAttribute("type");
|
||||||
$enc->link = $content->getAttribute("url");
|
$enc->link = $content->getAttribute("url");
|
||||||
$enc->length = $content->getAttribute("length");
|
$enc->length = $content->getAttribute("length");
|
||||||
@@ -174,6 +175,7 @@ class FeedItem_Atom extends FeedItem_Common {
|
|||||||
|
|
||||||
array_push($encs, $enc);
|
array_push($encs, $enc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$enclosures = $this->xpath->query("media:thumbnail", $this->elem);
|
$enclosures = $this->xpath->query("media:thumbnail", $this->elem);
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ class FeedItem_RSS extends FeedItem_Common {
|
|||||||
|
|
||||||
$content = $this->xpath->query("media:content", $enclosure)->item(0);
|
$content = $this->xpath->query("media:content", $enclosure)->item(0);
|
||||||
|
|
||||||
|
if ($content) {
|
||||||
$enc->type = $content->getAttribute("type");
|
$enc->type = $content->getAttribute("type");
|
||||||
$enc->link = $content->getAttribute("url");
|
$enc->link = $content->getAttribute("url");
|
||||||
$enc->length = $content->getAttribute("length");
|
$enc->length = $content->getAttribute("length");
|
||||||
@@ -154,6 +155,7 @@ class FeedItem_RSS extends FeedItem_Common {
|
|||||||
|
|
||||||
array_push($encs, $enc);
|
array_push($encs, $enc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$enclosures = $this->xpath->query("media:thumbnail", $this->elem);
|
$enclosures = $this->xpath->query("media:thumbnail", $this->elem);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user