From 11d271f3c5c43feffd6f858d5787e6e4ae0319d2 Mon Sep 17 00:00:00 2001 From: Dean Townsley Date: Sat, 8 Jul 2017 09:55:40 -0500 Subject: [PATCH] Only delete uid=0 entries when cleaning up extra public entries This delete can inadvertently remove contacts from normal users under some conditions. Since it appears to be intended to only operate on "public" (uid=0) contacts, this change constrains the delete query to only uid=0 records. --- include/Contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Contact.php b/include/Contact.php index 0aeabc9725..f99b0d5d0f 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -637,7 +637,7 @@ function get_contact($url, $uid = 0, $no_update = false) { } if (count($contacts) > 1 && $uid == 0 && $contact_id != 0 && $url != "") { - q("DELETE FROM `contact` WHERE `nurl` = '%s' AND `id` != %d AND NOT `self`", + q("DELETE FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0 AND `id` != %d AND NOT `self`", dbesc(normalise_link($url)), intval($contact_id)); } -- 2.39.5