From 45142a6b05194dee79ee088e8d6308b7ef5eb904 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 1 Dec 2009 04:41:31 +0000 Subject: [PATCH] Fixes for auto-purge scripts (missing array elements) --- inc/autopurge/purge-inact.php | 2 +- inc/autopurge/purge-mails.php | 4 ++++ inc/autopurge/purge-tsks.php | 3 ++- inc/autopurge/purge-unconfirmed.php | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index 652a561e2e..eb5bc27229 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -94,7 +94,7 @@ ORDER BY $content['time'] = (getConfig('ap_inactive_time') / 60 / 60); // Mark found accounts as inactive and send an email - while ($content = SQL_FETCHARRAY($result_inactive)) { + while ($content = merge_array($content, SQL_FETCHARRAY($result_inactive))) { // Remember userids for the admin $useridsContent .= $content['userid'].", "; diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php index 2a2df0f17a..29f1349733 100644 --- a/inc/autopurge/purge-mails.php +++ b/inc/autopurge/purge-mails.php @@ -69,6 +69,8 @@ if (SQL_NUMROWS($result_mails) > 0) { // Okay we found some mails! SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s", array(bigintval($content['sender'])), __FILE__, __LINE__); + + // Get all affected (deleted) rows $deletedStats += SQL_AFFECTEDROWS(); // Reset query (to prevent possible errors) ...; @@ -106,6 +108,8 @@ if (SQL_NUMROWS($result_mails) > 0) { // Okay we found some mails! SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `sender`=%s", array(bigintval($content['sender'])), __FILE__, __LINE__); + + // Get all affected (deleted) rows $deletedStats += SQL_AFFECTEDROWS(); // Reset query (to prevent possible errors) ... diff --git a/inc/autopurge/purge-tsks.php b/inc/autopurge/purge-tsks.php index d39f7f1981..708c880344 100644 --- a/inc/autopurge/purge-tsks.php +++ b/inc/autopurge/purge-tsks.php @@ -54,7 +54,8 @@ if ((isExtensionInstalledAndNewer('task') > '0.0') && (getConfig('autopurge_task FROM `{?_MYSQL_PREFIX?}_task_system` WHERE - `status`='DELETED' AND `task_created` <= (UNIX_TIMESTAMP() - {?ap_tasks_time?})", __FILE__, __LINE__); + `status`='DELETED' AND + `task_created` <= (UNIX_TIMESTAMP() - {?ap_tasks_time?})", __FILE__, __LINE__); // Get deleted rows $deletedTasks = SQL_AFFECTEDROWS(); diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index 31d825d5d0..faa5b76dfc 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -64,7 +64,7 @@ ORDER BY $content['time'] = (getConfig('ap_unconfirmed_time') / 60 / 60); // Delete inactive accounts - while ($content = SQL_FETCHARRAY($result_uncon)) { + while ($content = merge_array($content, SQL_FETCHARRAY($result_uncon))) { // Remember userids for the admin $userids .= $content['userid'] . ', '; -- 2.39.2