From 4c00e15b5d05b0d137af9a33bf79172bfeb0df24 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 1 May 2013 19:40:43 +0400 Subject: pass xpath object to feeditem, support media-rss objects --- classes/feedparser.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'classes/feedparser.php') diff --git a/classes/feedparser.php b/classes/feedparser.php index f127ba73d..eabbb5b28 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -27,6 +27,7 @@ class FeedParser { $root = $this->doc->firstChild; $xpath = new DOMXPath($this->doc); $xpath->registerNamespace('atom', 'http://www.w3.org/2005/Atom'); + $xpath->registerNamespace('media', 'http://search.yahoo.com/mrss/'); $this->xpath = $xpath; $root = $xpath->query("(//atom:feed|//channel)")->item(0); @@ -62,7 +63,7 @@ class FeedParser { $articles = $xpath->query("//atom:entry"); foreach ($articles as $article) { - array_push($this->items, new FeedItem_Atom($article)); + array_push($this->items, new FeedItem_Atom($article, $this->doc, $this->xpath)); } break; @@ -83,7 +84,7 @@ class FeedParser { $articles = $xpath->query("//channel/item"); foreach ($articles as $article) { - array_push($this->items, new FeedItem_RSS($article)); + array_push($this->items, new FeedItem_RSS($article, $this->doc, $this->xpath)); } break; -- cgit v1.2.3