From ff3ac1db730c57112f023029fc7afd61e1a9c5ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Wed, 3 Nov 2010 23:13:48 +0100 Subject: [PATCH] Cleaner queries while sending NL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- include/massmailer.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/massmailer.inc.php b/include/massmailer.inc.php index c866f90..8c132a1 100644 --- a/include/massmailer.inc.php +++ b/include/massmailer.inc.php @@ -209,18 +209,19 @@ abstract class MassMailer $emailsCount = 0; while (true) { + $sent = array(); $users = User::getBulkUsersWithUIDs(XDB::fetchColumn($query)); if (count($users) == 0) { return $emailsCount; } foreach ($users as $user) { - $sent[] = XDB::format('uid = {?}', $user->id()); + $sent[] = $user->id(); $this->sendTo($user, $hash); ++$emailsCount; } XDB::execute("UPDATE {$this->_subscriptionTable} SET last = {?} - WHERE " . implode(' OR ', $sent), $this->_id); + WHERE uid IN {?}", $this->_id, $sent); sleep(60); } -- 2.1.4