mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-10-12 11:31:00 +02:00
parser: fix failing on empty media:group tags
This commit is contained in:
parent
de0d8d1088
commit
2ab7ccb695
@ -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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user