From f7f9529f3bcdb671190b8dee42025dc2c35f171d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 3 Jun 2015 16:21:21 +0200 Subject: [PATCH] The duplication check made problems with killing too much items --- include/items.php | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/include/items.php b/include/items.php index 588bd353f7..6ac90bc1c9 100644 --- a/include/items.php +++ b/include/items.php @@ -1187,18 +1187,6 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa } } - // If there is no guid then take the same guid that was taken before for the same plink - if ((trim($arr['guid']) == "") AND (trim($arr['plink']) != "") AND (trim($arr['network']) != "")) { - logger('item_store: checking for an existing guid for plink '.$arr['plink'], LOGGER_DEBUG); - $r = q("SELECT `guid` FROM `guid` WHERE `plink` = '%s' AND `network` = '%s' LIMIT 1", - dbesc(trim($arr['plink'])), dbesc(trim($arr['network']))); - - if(count($r)) { - $arr['guid'] = $r[0]["guid"]; - logger('item_store: found guid '.$arr['guid'].' for plink '.$arr['plink'], LOGGER_DEBUG); - } - } - // Shouldn't happen but we want to make absolutely sure it doesn't leak from a plugin. // Deactivated, since the bbcode parser can handle with it - and it destroys posts with some smileys that contain "<" //if((strpos($arr['body'],'<') !== false) || (strpos($arr['body'],'>') !== false)) @@ -1415,16 +1403,6 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa return 0; } - $r = q("SELECT `id` FROM `item` WHERE `plink` = '%s' AND `network` = '%s' AND `uid` = %d LIMIT 1", - dbesc($arr['plink']), - dbesc($arr['network']), - intval($arr['uid']) - ); - if($r && count($r)) { - logger('duplicated item with the same plink found. ' . print_r($arr,true)); - return 0; - } - // Check for an existing post with the same content. There seems to be a problem with OStatus. $r = q("SELECT `id` FROM `item` WHERE `body` = '%s' AND `network` = '%s' AND `created` = '%s' AND `contact-id` = %d AND `uid` = %d LIMIT 1", dbesc($arr['body']),