diff options
author | Mario <mario@mariovavti.com> | 2020-05-11 20:22:25 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-05-11 20:22:25 +0000 |
commit | 2d3740b91246b37349b3ffa373f2706cd8b14b29 (patch) | |
tree | dc7ad0f666c7ad6c233ec248632ec88a3763f39e /include/items.php | |
parent | c8ab5db768b7c5772fa6525f49a7b2f5b0c6f9a5 (diff) | |
download | volse-hubzilla-2d3740b91246b37349b3ffa373f2706cd8b14b29.tar.gz volse-hubzilla-2d3740b91246b37349b3ffa373f2706cd8b14b29.tar.bz2 volse-hubzilla-2d3740b91246b37349b3ffa373f2706cd8b14b29.zip |
Legacy Hubzilla compatibility: when we relay a comment from hubzilla < 4.0, we send it to ourself again but this time with a valid uri as mid. To catch this as duplicate, we need to check for the basename aswell.
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php index 87ae5c6a5..a566ddfd9 100755 --- a/include/items.php +++ b/include/items.php @@ -1973,8 +1973,9 @@ function item_store($arr, $allow_exec = false, $deliver = true) { ); } else { - $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 mid = '%s') AND uid = %d and revision = %d LIMIT 1", dbesc($arr['mid']), + dbesc(basename(rawurldecode($arr['mid']))), // de-duplicate relayed comments from hubzilla < 4.0 intval($arr['uid']), intval($arr['revision']) ); |