Merge branch 'items_fixes' into 'dev'

item_store(): deduplicate by mid OR uuid possible fix for #1349

See merge request hubzilla/core!1570
This commit is contained in:
Max Kostikov 2019-03-24 16:45:21 +01:00
commit 333534dfe7

View File

@ -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'])
);