From a4d976b70f6cf5499d5a773bd89b94129ccf4179 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 19 May 2018 03:38:43 +0000 Subject: [PATCH 1/2] Fix: Avoid getting spammed when an admin has got several accounts --- mod/removeme.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mod/removeme.php b/mod/removeme.php index 252357c80d..dd0dc985a1 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -33,11 +33,12 @@ function removeme_post(App $a) // send notification to admins so that they can clean um the backups // send email to admins - $admin_mail_list = "'" . implode("','", array_map(dbesc, explode(",", str_replace(" ", "", $a->config['admin_email'])))) . "'"; - $adminlist = q("SELECT uid, language, email FROM user WHERE email IN (%s)", - $admin_mail_list - ); - foreach ($adminlist as $admin) { + $admin_mails = explode(",", str_replace(" ", "", $a->config['admin_email'])); + foreach (admin_mails as $mail) { + $admin = dba::selectFirst('user', ['uid', 'language', 'email'], ['email' => $mail]); + if (!DBM::is_result($admin)) { + continue; + } notification([ 'type' => SYSTEM_EMAIL, 'subject' => L10n::t('[Friendica System Notify]') . ' ' . L10n::t('User deleted their account'), From 1cd6976faa8bd3299ac1e8880014de47e88f2a01 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 19 May 2018 05:59:43 +0000 Subject: [PATCH 2/2] Fix missing $ --- mod/removeme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/removeme.php b/mod/removeme.php index dd0dc985a1..eb5c030c97 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -34,7 +34,7 @@ function removeme_post(App $a) // send notification to admins so that they can clean um the backups // send email to admins $admin_mails = explode(",", str_replace(" ", "", $a->config['admin_email'])); - foreach (admin_mails as $mail) { + foreach ($admin_mails as $mail) { $admin = dba::selectFirst('user', ['uid', 'language', 'email'], ['email' => $mail]); if (!DBM::is_result($admin)) { continue;