]> git.mxchange.org Git - friendica.git/commitdiff
Fix: Avoid getting spammed when an admin has got several accounts
authorMichael <heluecht@pirati.ca>
Sat, 19 May 2018 03:38:43 +0000 (03:38 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 19 May 2018 03:38:43 +0000 (03:38 +0000)
mod/removeme.php

index 252357c80d06f907c02efae331c57055dcc3b5ed..dd0dc985a1c95a66256164643e9804161f4ddc80 100644 (file)
@@ -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'),