summaryrefslogtreecommitdiff
path: root/classes/feeditem/atom.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/feeditem/atom.php')
-rw-r--r--classes/feeditem/atom.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php
index 244fb1f84..74be03d80 100644
--- a/classes/feeditem/atom.php
+++ b/classes/feeditem/atom.php
@@ -160,19 +160,21 @@ class FeedItem_Atom extends FeedItem_Common {
$content = $this->xpath->query("media:content", $enclosure)->item(0);
- $enc->type = $content->getAttribute("type");
- $enc->link = $content->getAttribute("url");
- $enc->length = $content->getAttribute("length");
-
- $desc = $this->xpath->query("media:description", $content)->item(0);
- if ($desc) {
- $enc->title = strip_tags($desc->nodeValue);
- } else {
- $desc = $this->xpath->query("media:description", $enclosure)->item(0);
- if ($desc) $enc->title = strip_tags($desc->nodeValue);
- }
+ if ($content) {
+ $enc->type = $content->getAttribute("type");
+ $enc->link = $content->getAttribute("url");
+ $enc->length = $content->getAttribute("length");
+
+ $desc = $this->xpath->query("media:description", $content)->item(0);
+ if ($desc) {
+ $enc->title = strip_tags($desc->nodeValue);
+ } else {
+ $desc = $this->xpath->query("media:description", $enclosure)->item(0);
+ if ($desc) $enc->title = strip_tags($desc->nodeValue);
+ }
- array_push($encs, $enc);
+ array_push($encs, $enc);
+ }
}
$enclosures = $this->xpath->query("media:thumbnail", $this->elem);