Bugfix for pull request 3216 - feed items were mixed

This commit is contained in:
Michael 2017-03-14 21:14:09 +00:00
parent 187a81f159
commit 35ec1c8f26

View file

@ -177,6 +177,10 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
foreach (array_reverse($entrylist) AS $entry) { foreach (array_reverse($entrylist) AS $entry) {
$item = array_merge($header, $author); $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)) if (is_object($alternate))
foreach($alternate AS $attributes) foreach($alternate AS $attributes)
if ($attributes->name == "href") if ($attributes->name == "href")
@ -217,10 +221,6 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
if ($item["title"] == "") if ($item["title"] == "")
$item["title"] = $xpath->evaluate('rss:title/text()', $entry)->item(0)->nodeValue; $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; $published = $xpath->query('atom:published/text()', $entry)->item(0)->nodeValue;
if ($published == "") if ($published == "")