parser: fix get_links() for RSS

This commit is contained in:
Andrew Dolgov 2013-05-24 14:40:47 +04:00
parent 5a6d7e7ace
commit f17c3ee29a
1 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,6 @@ class FeedParser {
break; break;
case $this::FEED_RSS: case $this::FEED_RSS:
$title = $xpath->query("//channel/title")->item(0); $title = $xpath->query("//channel/title")->item(0);
if ($title) { if ($title) {
@ -200,7 +199,8 @@ class FeedParser {
} }
break; break;
case $this::FEED_RSS: case $this::FEED_RSS:
$links = $this->xpath->query("//channel/link"); $links = $this->xpath->query("//atom:link");
foreach ($links as $link) { foreach ($links as $link) {
if (!$rel || $link->hasAttribute('rel') && $link->getAttribute('rel') == $rel) { if (!$rel || $link->hasAttribute('rel') && $link->getAttribute('rel') == $rel) {
array_push($rv, $link->getAttribute('href')); array_push($rv, $link->getAttribute('href'));