aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2020-09-30 00:40:46 +0000
committerMario <mario@mariovavti.com>2020-09-30 08:16:59 +0200
commit48440e368c07855285da35ea9d0875196919a70d (patch)
treefeed5fa59a8b6c9442bcd77483f0492704348a50 /Zotlabs/Lib/Libzot.php
parenta7bf07b864ab74884f3f2bfabd57d9aa5ae1e49c (diff)
downloadvolse-hubzilla-48440e368c07855285da35ea9d0875196919a70d.tar.gz
volse-hubzilla-48440e368c07855285da35ea9d0875196919a70d.tar.bz2
volse-hubzilla-48440e368c07855285da35ea9d0875196919a70d.zip
bug: undoing a like on a comment can remove the comment
(cherry picked from commit b999456bf16a5d457a16fab1299289cfb54bfed4)
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r--Zotlabs/Lib/Libzot.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index f4eb26463..ce9536cd4 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1739,11 +1739,15 @@ class Libzot {
continue;
}
+ // reactions such as like and dislike could have an mid with /activity/ in it.
+ // Check for both forms in order to prevent duplicates.
- $r = q("select * from item where mid = '%s' and uid = %d limit 1",
+ $r = q("select * from item where mid in ('%s','%s') and uid = %d limit 1",
dbesc($arr['mid']),
+ dbesc(str_replace(z_root() . '/activity/', z_root() . '/item/', $arr['mid'])),
intval($channel['channel_id'])
);
+
if($r) {
// We already have this post.
$item_id = $r[0]['id'];