]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: Feeds weren't imported if a post with the same URI existed.
authorMichael Vogel <icarus@dabo.de>
Sat, 10 Oct 2015 12:26:07 +0000 (14:26 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 10 Oct 2015 12:26:07 +0000 (14:26 +0200)
include/feed.php
include/items.php

index dd360a07b58bf46df256c3143e97329435617a1f..f11bb52a1bf4dd3e8153cef2a9971c5250dcc6a0 100644 (file)
@@ -201,8 +201,8 @@ function feed_import($xml,$importer,&$contact, &$hub) {
 
                //$item["object"] = $xml;
 
-               $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s'",
-                       intval($importer["uid"]), dbesc($item["uri"]));
+               $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` = '%s'",
+                       intval($importer["uid"]), dbesc($item["uri"]), dbesc(NETWORK_FEED));
                if ($r) {
                        logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already existed under id ".$r[0]["id"], LOGGER_DEBUG);
                        continue;
index 8691ccca495f38f023608d86c15616fb3eac02e8..1506e737bae4346a28ca9a103d8a4335bc1fa363 100644 (file)
@@ -1489,9 +1489,10 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
        $arr = $unescaped;
 
        // find the item we just created
-       $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = %d ORDER BY `id` ASC ",
+       $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = %d AND `network` = '%s' ORDER BY `id` ASC ",
                dbesc($arr['uri']),
-               intval($arr['uid'])
+               intval($arr['uid']),
+               dbesc($arr['network'])
        );
 
        if(count($r)) {