aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-03-24 15:47:57 +0100
committerMario Vavti <mario@mariovavti.com>2019-03-24 15:47:57 +0100
commit0d0ede7b14bcfa79340d52ad934fc0c186aa4c02 (patch)
tree44162f6933550e36a722aa81650e3bd0327bc06a
parent33ac85f637be3c7888142d175d822e14d7cb6bd2 (diff)
downloadvolse-hubzilla-0d0ede7b14bcfa79340d52ad934fc0c186aa4c02.tar.gz
volse-hubzilla-0d0ede7b14bcfa79340d52ad934fc0c186aa4c02.tar.bz2
volse-hubzilla-0d0ede7b14bcfa79340d52ad934fc0c186aa4c02.zip
item_store(): deduplicate by mid OR uuid
-rwxr-xr-xinclude/items.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php
index c9c2e2d48..6857964fb 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1930,8 +1930,9 @@ function item_store($arr, $allow_exec = false, $deliver = true) {
if($parent_deleted)
$arr['item_deleted'] = 1;
- $r = q("SELECT id FROM item WHERE mid = '%s' AND uid = %d and revision = %d LIMIT 1",
+ $r = q("SELECT id FROM item WHERE (mid = '%s' OR uuid = '%s') AND uid = %d and revision = %d LIMIT 1",
dbesc($arr['mid']),
+ dbesc($arr['uuid']),
intval($arr['uid']),
intval($arr['revision'])
);