From 35ec1c8f266d944f1b4d0359cd80a35c2f120ffa Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 14 Mar 2017 21:14:09 +0000 Subject: [PATCH] Bugfix for pull request 3216 - feed items were mixed --- include/feed.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/feed.php b/include/feed.php index e0fef50dbb..13833d22ef 100644 --- a/include/feed.php +++ b/include/feed.php @@ -177,6 +177,10 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) { foreach (array_reverse($entrylist) AS $entry) { $item = array_merge($header, $author); + $alternate = $xpath->query("atom:link[@rel='alternate']", $entry)->item(0)->attributes; + if (!is_object($alternate)) + $alternate = $xpath->query("atom:link", $entry)->item(0)->attributes; + if (is_object($alternate)) foreach($alternate AS $attributes) if ($attributes->name == "href") @@ -217,10 +221,6 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) { if ($item["title"] == "") $item["title"] = $xpath->evaluate('rss:title/text()', $entry)->item(0)->nodeValue; - $alternate = $xpath->query("atom:link[@rel='alternate']", $entry)->item(0)->attributes; - if (!is_object($alternate)) - $alternate = $xpath->query("atom:link", $entry)->item(0)->attributes; - $published = $xpath->query('atom:published/text()', $entry)->item(0)->nodeValue; if ($published == "")