From 8a730b2d85ea14daf08f56b1df010f7592838849 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 18 Apr 2018 05:02:59 +0000 Subject: [PATCH] Issue 4655: Avoid multiplicated contact requests from the same account --- src/Model/Contact.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index eeecac1465..48e8be3106 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1482,6 +1482,11 @@ class Contact extends BaseObject } // send email notification to owner? } else { + if (dba::exists('contact', ['nurl' => normalise_link($url), 'uid' => $importer['uid'], 'pending' => true])) { + logger('ignoring duplicated connection request from pending contact ' . $url); + return; + } + // create contact record q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `name`, `nick`, `photo`, `network`, `rel`, `blocked`, `readonly`, `pending`, `writable`)