From a28a17d963d1b426f62995cdba2b54087cb33759 Mon Sep 17 00:00:00 2001 From: rj-taylor <57951629+rj-taylor@users.noreply.github.com> Date: Tue, 19 Nov 2019 14:25:11 -0500 Subject: [PATCH] Fixed syslog pruning when dbFetchRow() returns array (#10850) If dbFetchRow() returns an array, dbDelete() won't do its work pruning the syslog table and we'll drop out of the block via break. This if statement will take the value return inside the array and replace $limit with that value. This way, dbDelete() can successfully prune the syslog table. dbFetchCell() can return an array that won't work when fed to dbDelete(). This keeps that from occurring so the syslog table can be pruned. --- daily.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daily.php b/daily.php index d3061363e7..3bf7dab1c8 100644 --- a/daily.php +++ b/daily.php @@ -71,7 +71,7 @@ if ($options['f'] === 'syslog') { if (is_numeric($syslog_purge)) { $rows = (int)dbFetchCell('SELECT MIN(seq) FROM syslog'); while (true) { - $limit = dbFetchRow('SELECT seq FROM syslog WHERE seq >= ? ORDER BY seq LIMIT 1000,1', array($rows)); + $limit = dbFetchCell('SELECT seq FROM syslog WHERE seq >= ? ORDER BY seq LIMIT 1000,1', array($rows)); if (empty($limit)) { break; }